- When the class is loaded for the first time, Java uses the delegation mechanism to load the bytecode of the corresponding class into the JVM's metaspace.
- Allocate memory space for static variables in the class and assign values to them.
- Allocate a memory area in the JVM heap for the object.
- 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.