JavaScript is disabled on your browser.

  * [ Overview ](../../overview-summary.html)
  * [ Package ](package-summary.html)
  * Class 
  * [ Use ](class-use/Objects.html)
  * [ Tree ](package-tree.html)
  * [ Deprecated ](../../deprecated-list.html)
  * [ Index ](../../index-files/index-1.html)
  * [ Help ](../../help-doc.html)

_**Java™ Platform  
Standard Ed. 7 ** _

  * [ Prev Class  ](../../java/util/NoSuchElementException.html "class in java.util")
  * [ Next Class  ](../../java/util/Observable.html "class in java.util")

  * [ Frames ](../../index.html?java/util/Objects.html)
  * [ No Frames ](Objects.html)

  * [ All Classes ](../../allclasses-noframe.html)

  * Summary: 
  * Nested | 
  * Field | 
  * Constr | 
  * Method 

  * Detail: 
  * Field | 
  * Constr | 
  * Method 

java.util

##  Class Objects

  * [ java.lang.Object ](../../java/lang/Object.html "class in java.lang")
  *     * java.util.Objects 

  * * * *

  

    
        public final class Objects
    extends [Object](../../java/lang/Object.html "class in java.lang")

This class consists of ` static ` utility methods for operating on objects.
These utilities include ` null ` -safe or ` null ` -tolerant methods for
computing the hash code of an object, returning a string for an object, and
comparing two objects.

Since:

     1.7 

  *     * ###  Method Summary 

Methods  Modifier and Type  |  Method and Description   
---|---  
` static <T> int ` |  ` **[ compare ](../../java/util/Objects.html#compare\(T,%20T,%20java.util.Comparator\)) ** (T a, T b, [ Comparator ](../../java/util/Comparator.html "interface in java.util") <? super T> c) ` Returns 0 if the arguments are identical and ` c.compare(a, b) ` otherwise.   
` static boolean ` |  ` **[ deepEquals ](../../java/util/Objects.html#deepEquals\(java.lang.Object,%20java.lang.Object\)) ** ( [ Object ](../../java/lang/Object.html "class in java.lang") a, [ Object ](../../java/lang/Object.html "class in java.lang") b) ` Returns ` true ` if the arguments are deeply equal to each other and ` false ` otherwise.   
` static boolean ` |  ` **[ equals ](../../java/util/Objects.html#equals\(java.lang.Object,%20java.lang.Object\)) ** ( [ Object ](../../java/lang/Object.html "class in java.lang") a, [ Object ](../../java/lang/Object.html "class in java.lang") b) ` Returns ` true ` if the arguments are equal to each other and ` false ` otherwise.   
` static int ` |  ` **[ hash ](../../java/util/Objects.html#hash\(java.lang.Object...\)) ** ( [ Object ](../../java/lang/Object.html "class in java.lang") ... values) ` Generates a hash code for a sequence of input values.   
` static int ` |  ` **[ hashCode ](../../java/util/Objects.html#hashCode\(java.lang.Object\)) ** ( [ Object ](../../java/lang/Object.html "class in java.lang") o) ` Returns the hash code of a non- ` null ` argument and 0 for a ` null ` argument.   
` static <T> T ` |  ` **[ requireNonNull ](../../java/util/Objects.html#requireNonNull\(T\)) ** (T obj) ` Checks that the specified object reference is not ` null ` .   
` static <T> T ` |  ` **[ requireNonNull ](../../java/util/Objects.html#requireNonNull\(T,%20java.lang.String\)) ** (T obj, [ String ](../../java/lang/String.html "class in java.lang") message) ` Checks that the specified object reference is not ` null ` and throws a customized [ ` NullPointerException ` ](../../java/lang/NullPointerException.html "class in java.lang") if it is.   
` static [ String ](../../java/lang/String.html "class in java.lang") ` |  ` **[ toString ](../../java/util/Objects.html#toString\(java.lang.Object\)) ** ( [ Object ](../../java/lang/Object.html "class in java.lang") o) ` Returns the result of calling ` toString ` for a non- ` null ` argument and ` "null" ` for a ` null ` argument.   
` static [ String ](../../java/lang/String.html "class in java.lang") ` |  ` **[ toString ](../../java/util/Objects.html#toString\(java.lang.Object,%20java.lang.String\)) ** ( [ Object ](../../java/lang/Object.html "class in java.