java-Initialization Process
the initialization process of an object
1,JVM loading the class memory
2, the static code block executes (without skipping it) and initializes the class
3, open up heap memory space, allocate memory address
4, the private member variable is initialized by default first,
5, the object is displayed for initialization
6, and then construct the code block initialization (skip if not)
7, constructor initialization
8, assign the memory address to the P (object) variable in the stack memory
Two object invocation members
1, object in heap memory
2, class variable in stack memory
3, method and static data in data area
Process:
When a class variable calls a method of a data region, the heap memory address is assigned to the class variable, the this pointer.
Copyright NOTICE: Welcome to Exchange, QQ872785786
java-initialization Process