Object Superclass
Understand the Object class in detail.
What is the Object class?
The Object class is the superclass of all the other classes in Java. It’s part of the java.lang package.
If a parent class isn’t specified using the extends keyword, the class will inherit from the Object class. For example:
public class A
{
// class defintion
}
Here, class A inherits from the Object class by default.
✏️ Note: Here’s the complete official documentation of the
Objectclass.
Methods from the Object class
The following two main methods of Object class are used:
- The
Ask