public class ObjectUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(java.lang.Object obj1,
java.lang.Object obj2)
Returns
true if the objects are equal or both
null , and false otherwise. |
static int |
hashCode(java.lang.Object obj)
Returns the hash code for the object, or 0 if the object is
null . |
public static boolean equals(java.lang.Object obj1, java.lang.Object obj2)
true
if the objects are equal or both
null
, and false
otherwise. In Java 7, we
could use the Objects
class instead.obj1
- object 1.obj2
- object 2.public static int hashCode(java.lang.Object obj)
null
. In Java 7, we could use the Objects
class instead.obj
- the object (null
permitted).