I am Utpal Vishwas from Uttar Pradesh. Have completed my B. Tech. course from MNNIT campus Prayagraj in 2022. I have good knowledge of computer networking.
A class loader is a Java object responsible for loading Java classes into the Java Virtual Machine (JVM). Class loaders are responsible for finding the class files, loading them into memory, and linking them with other classes.
There are three types of class loaders in Java:
Bootstrap class loader: This is the parent of all class loaders. It is responsible for loading the core Java classes, such as the
java.lang package.
Extension class loader: This class loader is responsible for loading the extensions of core Java classes, such as the
java.sql package.
System class loader: This class loader is responsible for loading the application classes, such as the classes that are defined in the
.jar files that are specified in the CLASSPATH environment variable.
When a class is loaded, the class loader follows these steps:
Find the class file. The class loader looks for the class file in the following locations:
The classpath
The current directory
The directories specified in the java.class.path system property
Load the class file into memory. The class loader reads the class file into memory and parses it.
Link the class with other classes. The class loader links the class with other classes that it depends on.
Initialize the class. The class loader initializes the class by calling its
<clinit> method.
Class loaders are an important part of the Java runtime environment. They allow Java programs to be modular and reusable. They also help to ensure that Java programs are secure and safe.
Here are some of the important features of class loaders:
Delegation: When a class loader is asked to load a class, it delegates the request to its parent class loader. This process continues until the bootstrap class loader is reached.
Visibility: A class loader can only see the classes that are loaded by it or its parent class loaders.
Uniqueness: A class can only be loaded once by a class loader.
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
A class loader is a Java object responsible for loading Java classes into the Java Virtual Machine (JVM). Class loaders are responsible for finding the class files, loading them into memory, and linking them with other classes.
There are three types of class loaders in Java:
java.langpackage.java.sqlpackage..jarfiles that are specified in theCLASSPATHenvironment variable.When a class is loaded, the class loader follows these steps:
java.class.pathsystem property<clinit>method.Class loaders are an important part of the Java runtime environment. They allow Java programs to be modular and reusable. They also help to ensure that Java programs are secure and safe.
Here are some of the important features of class loaders: