Objects.equals and Object.equals

The difference is the Objects.equals() considers two nulls to be “equal”. The pseudo code is:

  1. if both parameters are null or the same object, return true
  2. if the first parameter is null return false
  3. 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).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)