In this tutorial, we’ll explore the static variable initialization process. The Java Virtual Machine (JVM) follows this process during class loading.

Initialization Process

At a high level, the JVM performs the following steps:

First, the class is loaded and linked. Then, the “initialize” phase of this process processes the static variable initialization. Finally, the main method associated with the class is called.

In the next section, we’ll look at class variable initialization.

#Java

When are Static Variables Initialized in Java?
1.75 GEEK