- When the class is loaded for the first time, Java uses the delegation mechanism to load the corresponding class bytecode into the JVM's metaspace.
- Allocate memory space for static variables in the class and assign values to them.
- Allocate a memory area for the object in the JVM heap.
- Assign initial values to instance variables in the object.
- Execute the initialization method of the class (constructor, init method, etc.).
- Assign the object address to the corresponding variable.