The creation of objects is down to the JVM. Every constructor in Java appears as a special method named <init>
which is responsible for instance initializing. This <init>
method is supplied by the compiler and because <init>
is not a valid identifier in Java, it cannot be used directly in the language.
How does the JVM invoke this <init>
method?
The JVM will invoke the <init>
method using the invokespecial
instruction and can only be invoked on uninitialized class instances.
What will happen in the Object class constructor?
Nothing more than would happen in a subclass that has a default empty constructor (minus the call to super()
).
The default constructor can be explicitly defined, if not the compiler will put it in for you as long as no other constructor is already defined.
For more information take a look at the JVM specification and the Java Language Specification: