Class Loading, Linking, and Initialization
Before a class can be used, the JVM loads its class representation, verifies and prepares it, resolves symbolic references as required, and initializes static state when initialization is triggered.
Class loaders form a delegation hierarchy. Loader identity is part of a class's runtime identity, so the same binary name loaded by different defining loaders represents distinct runtime types.
Class<?> type = Class.forName("java.lang.String");
System.out.println(type.getClassLoader());
This enables plugins and isolation while also creating class-loader leak risks when long-lived references retain unloadable class loaders.
Key Takeaways
Loading, linking, and initialization are distinct concepts.
Class identity includes the defining class loader.
Custom class loaders are powerful but add lifecycle complexity.