- Bootstrap – The native implementation embedded within the JVM itself, and the parent of all other class loaders. It loads a part of core Java classes from
java.*
packages. - Platform – Responsible for loading standard Java runtime classes. Prior to Java 9, it was called Extension class loader and handled the loading of extensions. It is guaranteed to have visibility (though not necessarily direct loading responsibility) of all standard Java SE and JDK classes.
- System (Application) – Loads classes from the classpath of a specific application.
Before attempting to load a class, a
ClassLoader
checks if its parent can load it first. If the class is already loaded, no further loading is needed.An illustration of the significance of this hierarchy can be seen in the Apache Tomcat web server loaders. The application code for each web application operates on its separate loader, isolated from other applications. Even the same singleton class in each application will be distinct. System classes and shared libraries, meanwhile, are loaded by their parent class loaders, just once for the entire server.