It is a part of the Java Runtime Environment which is used to dynamically load the class files into the Java Virtual Machine(JVM). The classloader triggers whenever a java file is executed.
There are three types of classloaders in Java:
Bootstrap Classloader: The bootstrap loader is the superclass of extension classloader which loads the standard JDK files from rt.jar and other core classes. The rt.jar file contains all the package classes of java.net, java.lang, java.util, java.io, java.sql, etc.
Extension Classloader: The extension classloader is known as the parent of the System classloaders and the child of the Bootstrap classloader. It only loads the files available in the extension classpath, that is ‘ext.dirs/JRE/lib/ext directory. If the file is not available in the mentioned directory the extension classloader will delegate it to the System classloader.
System/Application Classloader: It loads the classes of application type available in the environment variable such as -classpath, or -cp command-line option. The application classloader generates a ClassNotFoundException if the class is not available in the application classpath.