← Back to libraryQuestion 24 of 273
JavaAdvanced

Class Loaders

📖 Detailed Explanation:

Class Loaders dynamically load Java classes into the JVM at runtime. They follow a 'Delegation Hierarchy' where a loader first asks its parent to load the class before trying itself. The three main loaders: Bootstrap Loader (core Java APIs), Extension Loader (ext folder), and Application Loader (classpath). Understanding this is critical for security and understanding ClassNotFoundException.

🌍 Real-World Example:

A manager asks their supervisor if they have the answer before answering themselves. If the supervisor doesn't know, then the manager finds the answer.

🎯 Scenario-Based Interview Question:

What is the 'Delegation Hierarchy' in Class Loaders and why is it important for security?