Class Object is the root of the class hierarchy. Every class has Object as a super class. All objects, including arrays, implement the methods of this class.

 

Every class in the Java system is a descendent (direct or indirect) of the Object class. The Object class defines the basic state and behavior that all objects must have, such as the ability to compare oneself to another object, to convert to a string, to wait on a condition variable, to notify other objects that a condition variable has changed, and to return the object’s class.

 

Object is a super class of all other languages. This means that a reference variable of type Object can refer of any other class.

Object defines the following methods, which means that they are available in every object.

 

 

Methods:

 

clone( ) :  It creates a new object, which is same as the Object being cloned.

 

equals( ) :it checks whether the object is equal or not.

finalize( ):the method is called by the garbage collector when it determines no more references to the object exist.

getClass( ) : it gets the class of an object at runtime.

hashcode( ) :it returns the hash code associated with the invoking object.

toString( ) :returns the string which describes the object

wait( ) :waits till another thread to complete execution

notify ():it resumes execution of a thread waiting on invoking object

notifyAll( ):it resumes execution of all threads waiting on the invoking object.