Object Class is the root of the class hierarchy in Java. Every class has a Object class as a super class. Hence all the objects extends the methods of this class. Introduced in JDK1.0

The Object class, in the java.lang package, sits at the top of the class hierarchy tree. Every class is a descendant, direct or indirect, of the Object class. Every class you use or write inherits the instance methods of Object. You need not use any of these methods, but, if you choose to do so, you may need to override them with code that is specific to your class. The methods inherited from Object are given below.

Constructor Summary

Specifier/Return Name Description Detailed Example
No specifier for constructor Object() Constructor of object class click here

Method Summary

Specifier/Return Name Description Detailed Example
protected,Object clone() Creates and returns a copy of this object. click here
boolean equals(Object obj) Indicates whether some other object is “equal to” this one. click here
protected,void finalize() Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. click here
Class getClass() Returns the runtime class of this Object. click here
int hashCode() Returns a hash code value for the object. click here
void notify() Wakes up a single thread that is waiting on this object’s monitor. click here
void notifyAll() Wakes up all threads that are waiting on this object’s monitor. click here
String toString() Returns a string representation of the object. click here
void wait() Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object. click here
void wait(long timeout) Causes the current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed. click here
void wait(long timeout, int nanos) Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed. click here