How to use Object Class Constructor
Before going into the Object constructor let us know what is a constructor?
A class contains constructors that are invoked to create objects from the class blueprint. Constructor declarations look like method declarations except that they use the name of the class and have no return type.
Object class had one constructor with no parameters.
public Object()
Example Code Snippet:
public class ObjectConstructorInDetail {
public static void main(String[] args) {
//Object() constructor creates an instance of Object class
Object object = new Object();
}
}
Enjoy Reading This Article?
Here are some more articles you might like to read next: