ClassLoader Hierarchy and Custom Loaders
Understand bootstrap, platform, and application class loaders and write a custom ClassLoader.
The ClassLoader Hierarchy
The JVM uses a hierarchy of ClassLoaders. Each loader has a parent; before loading a class itself, it delegates to the parent (parent-first delegation model).
Bootstrap ClassLoader
The bootstrap ClassLoader loads core JDK classes (java.lang.*, java.util.*). It is implemented in native code and has no Java parent; getParent() returns null.
ClassLoader cl = String.class.getClassLoader();
System.out.println(cl); // null (bootstrap ClassLoader)All lessons in this course
- Class Loading Phases: Load, Link, Initialize
- ClassLoader Hierarchy and Custom Loaders
- Inspecting Bytecode with javap
- JIT Compilation and Tiered Compilation