Java class loading process, java class loading
1. Load. Load the. class file to the memory.
2. Create a Class and create the corresponding java. lang. Class Object (the java. lang. Class Object is used to encapsulate the data structure of the Class in the method area)
3. Verify and check whether the. class file complies with the. class File Specification.
4. Prepare, allocate memory for static variables, and assign the default value (for example, static int I = 5, at this time I is assigned 0)
5. Connect to convert a symbolic reference (the description of the reference relationship in the. class file) to a direct reference (real memory address reference)
6. initialize the static variable, assign the initial value to the static variable (for example, static int I = 5. At this time, I is assigned a value of 5), and execute the static code block.