Java / Object, Class and Package
When a class is loaded in Java?
Class loading is performed by ClassLoaders in Java which can be implemented to eagerly load a class as soon as another class references it or lazily load the class until a need of class initialization occurs.
If a Java class is loaded before its actually being used it resided at JVM before being initialized. This differs between JVM to JVM. While its guaranteed by JLS that a class will be loaded when there is a need of static initialization.
More Related questions...