Imagine a Java class that has most of the features you can find in a class. For example: it inherits from another class, implements a couple of interfaces, includes some "static final" constants, some final constants, some static variables, instance variables, a static block, an unnamed code block (only code in {}), constructors, methods etc.
When the class in question is loaded into the JVM for the first time, in what order are the various parts of the class initialized or loaded into the JVM? What does the call stack look like in the JVM for loading? Assume that only one class loader works here.
This goes back to the absolute basics / internals of Java, but I could not find a good article explaining the correct sequence.
java initialization class classloader
Thimmayya
source share