Java in a class member variable initialization process

Student s = new Student();

1. Load Student.class file into memory
2. s open space in the stack memory
3. In the heap memory space for students open the object
4. The member variables of the object's default initialization students
5. Student member variables of an object for display initialization
6. assigned by the constructor of member variables of an object student
7. students object initialization is complete, the target address is assigned to the variable s

Guess you like

Origin blog.51cto.com/14651315/2464214