Introduction to the Object Class
The Object class from java.lang package is the root class of all classes in Java Programming Langauge. All classes have the Object class as its Superclass (Parent class).
How to view the Object Class Code?
You can find the Object.class file in the core API rt.jar (Java Runtime Environment), If you use IDE like IntelliJ or Visual Studio Code, you can make use of the built-in decompiler.
Using IntelliJ:
- Right Click on the Object keyword in a file and select Go To -> Implementation (s)
You can also make use of decompilers or view the code online http://www.docjar.com/html/api/java/lang/Object.java.html.
List of Methods in Object.java class
There are 12 methods available in the Object class. The methods from the Object class are available for all classes that we create. Out of these 12 methods, 7 methods are of type native - they are defined and executed using code written in another programming language native to the Operating System (mostly C Langauge)
- private static native void registerNatives();
- public final native Class<?> getClass();
- public native int hashCode();
- protected native Object clone();
- public final native void notify();
- public final native void notifyAll();
- public final native void wait(long timeout);
- public boolean equals(Object obj)
- public String toString()
- public final void wait(long timeout, int nanos)
- public final void wait()
- protected void finalize()
This is not an AI-generated article but is demonstrated by a human on an M1 Mac running macOS Sonoma 14.0.
Please support independent contributors like Code2care by donating a coffee.
Buy me a coffee!




Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!