java.util.Objects.isNull vs object == null

should use object == null over Objects.isNull() in a if statement?

If you look at the source code of IsNull method,

 /* Returns true if the provided reference is null otherwise returns false.*/

 public static boolean isNull(Object obj) {
     return obj == null;
 }

It is the same. There is no difference. So you can use it safely.

Leave a Comment

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