Is there any ready implementation of method
public static boolean equals(Object o1, Object o2) {
return o1==null && o2==null || o1!=null && o2!=null && o1.equals(o2);
}
somewhere in JRE/JDK?
If you are on JDK 7..
Objects.equals(a,b)
That's Objects with an s, which is in java.util, as in the utility library for objects, similar to Collections with an s and Arrays with an s.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With