ClassLoader

= Class loader =

It's part of the Java Runtime Environment JRE and it loads dynamically the Java classes on the JVM on demand. In my oppinion the best feature it offers is the delegation model where we can see 4 different types of Class loaders:


 * User-defined Class Loader: the class loader that we could create.
 * System Class Loader: It loads the classes specified in the CLASSPATH system variable.
 * Extension Class Loader: It loads the extensions classes except the basic Java APIs.
 * Bootstrap Class Loader: It loads the the Java APIs, developed with JNI (Java Native Interface) is created when the JVM is runned.

So the Class loader acts when an unloaded class is found in 3 phases:
 * Loading: It loads the .class file into the JVM memory.
 * Linking
 * Verifying: It's the heaviest task in the whole process. It consits on checking if the class is configured as described in the JVM specifications.
 * Preparing: Prepares the data structure where classes will be stored.
 * Resolving: Transform all the symbolic references to direct references.
 * Initializing: Initializes the values of the class variables and execute the static initializers and assign the static fields values.

We could even create our own ClassLoader as it explains [here].

Maybe it's a good opportunity to get introduced to more advanced topics like [reflection]

Binildas Christudas explains better than me how it works [here]