Class loading process, the class loading process mainly includes loading, verification, preparation, parsing, initialization, use, uninstall seven aspects, the following one.

  

A, load,

During the load phase, the virtual machine does three things:

  

  

  

  

Second, validation,

The validation phase serves as assurance

  

  

  

  

  

Three, preparation,

The preparation phase allocates memory for variables and sets the initialization of class variables. Only class variables are allocated at this stage

  

So at this stage,

  

Four, parsing,

The parsing process is to replace symbolic references in the constant pool with direct references. Mainly includes the resolution of four types of references. Class or interface resolution, field resolution, method resolution, interface method resolution.

  

5. Initialization

In the preparation phase, class variables are initialized once. In this phase, class variables and other resources are initialized according to the program’s plan. These resources include

As for the use and uninstall phases, I will not say too much here. The use process is performed according to the behavior defined by the program