An Object instantiation process:
Person p = new person ();
1,JVM reads the Person.class file under the specified path, loads it into memory, and loads the person's parent class first, if there is a direct parent class.
2. Open space in heap memory, assign address.
3, and in object space, the default initialization of the properties in the object (the base type assigns the initial value).
4, the corresponding constructor is called to initialize.
5, in the constructor, the first row is initialized by calling the constructor in the parent class first.
6, when the parent class is initialized, the properties of the child class are displayed for initialization.
7, in the specific initialization of the subclass constructor.
8, the address value is assigned to the reference variable when the initialization is complete.
Object instantiation of Java Learning