Compiler Rules for Class Construction in Java
Objects in Java are created from inside out.
It goes all the the way up to the Object class, comes down through the hierarchy and initializes all instance variables to create objects.
public class Person {
private String name;
}
In the above code, there is no statement that the Person extends Object but when creating an object, it…