The difference is the Objects.equals() considers two nulls to be “equal”. The pseudo code is:
- if both parameters are
nullor the same object, returntrue - if the first parameter is
nullreturnfalse - return the result of passing the second parameter to the
equals()method of the first parameter
This means it is “null safe” (non null safe implementation of the first parameter’s equals() method notwithstanding).