Class Loaders are JVM components responsible for dynamically loading Java classes into memory at runtime. They follow a parent delegation model, where a class loader first delegates the loading request to its parent before attempting to load the class itself. This mechanism improves security, avoids duplicate class loading, and ensures consistent class management across applications.
When a Java application starts, classes like String and Object are loaded by the Bootstrap ClassLoader. JDK platform modules are loaded by the Platform ClassLoader, while application-specific classes such as Employee or CustomerService are loaded by the Application ClassLoader.
public class ClassLoaderDemo {
public static void main(String[] args) {
System.out.println(
String.class.getClassLoader());
System.out.println(
ClassLoaderDemo.class.getClassLoader());
}
}null
jdk.internal.loader.ClassLoaders$AppClassLoader
A concise interview answer is: Java primarily uses three class loaders: Bootstrap ClassLoader, Platform (Extension) ClassLoader, and Application (System) ClassLoader. They work in a hierarchical parent delegation model where core JDK classes are loaded first, followed by platform libraries and finally application-specific classes.
Last updated: 16 July 2026
Previous question: What is the difference between Class.forName() and ClassLoader.loadClass()?