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).
Object class is available since Java version 1.0
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.
- 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!
Facing issues? Have Questions? Post them here! I am happy to answer!
- CRUD operations in Spring Boot + JDBC
- Java Check Leap Year - Programs with Code Examples
- [fix] Java JDBC ConnectException: Connection refused
- How to add hours and minutes to Java Instant
- Java Program: Random Number Generator
- Java: The value of the local variable string is not used
- How to get list of all Java versions installed on macOS
- Java SE JDBC with Prepared Statement Parameterized Select Example
- Java + Spring JDBC Template + Gradle Example
- Convert String to LocalDate in Java
- Remove Trailing zeros BigDecimal Java
- Java 8 Predicate Functional Interface isEqual() Method Example
- How to Hardcode Date in Java with Examples
- Java 8: Predicate negate() default Function Example
- Java: Collect Stream as ArrayList or LinkedList
- The Motivation Behind Generics in Java Programming
- How to Add/Subtract Days to the Current Date in Java
- Error: Can not find the tag library descriptor for
- Setting up JUnit 5 dependency with Maven Example
- Run Java Code Every Second
- How to create a tar.gz file using Java
- [Fix] java: integer number too large compilation error
- Java 8: Find the Max value in a List
- Your JBoss Application Server 7 is running However you have not yet added any users to be able to access the admin console
- Convert Java Array to ArrayList Code Example
- How to Copy Entire Directory to another Directory in Linux - Linux
- Command to know the installed Debian version? - Linux
- Calculate Sum of List elements using Java Streams - Java
- Unable to load VM from snapshot. The snapshot has been saved for a different hardware configuration - Android
- How to know if you are on iOS 17 on your iPhone - iOS
- [Fix] Ubuntu E: Unable to locate package sudo error - Ubuntu
- 3 Python program to add two numbers - Python
- Cannot create new Microsoft Team using PowerShell, even as Admin - Teams