Java Object Class
The Java Object class is the parent class of all classes, which means all Java classes inherit from Object,Subclasses can use all of Object's methods.

The Object class is in the java.lang package and is automatically imported at compile time. When we create a class, if we do not explicitly inherit a parent class, it will automatically inherit Object and become a subclass of Object.
The Object class can be explicitly or implicitly inherited; the following two approaches are the same:
Explicit inheritance:
public class Runoob extends Object{
}
Implicit inheritance:
public class Runoob {
}
Class constructor
| No. | Constructor & Description |
|---|---|
| 1 |
Object() Constructs a new object. |
Class methods
| No. | Method & Description |
|---|---|
| 1 | protected Object clone()
Creates and returns a copy of an object |
| 2 | boolean equals(Object obj)
Compares whether two objects are equal |
| 3 | protected void finalize()
Called by the garbage collector on an object when the GC (garbage collector) determines that there are no more references to the object. |
| 4 | Class> getClass()
Gets the runtime class of the object |
| 5 | int hashCode()
Gets the hash value of the object |
| 6 | void notify()
Wakes up a single thread waiting on this object |
| 7 | void notifyAll()
Wakes up all threads waiting on this object |
| 8 | String toString()
Returns a string representation of the object |
| 9 | void wait()
Causes the current thread to wait until another thread calls the notify() or notifyAll() method of this object. |
| 10 | void wait(long timeout)
Causes the current thread to wait (block) until another thread calls the notify() or notifyAll() method of this object, or the timeout set by the argument elapses. |
| 11 | void wait(long timeout, int nanos)
Similar to the wait(long timeout) method, with one more nanos argument, which represents the extra time (in nanoseconds, ranging from 0 to 999999). So the timeout must also add the nanos nanoseconds. |