---
title: "What is a ClassLoader?"  
description: "What is a ClassLoader?"  
author: "Utpal Vishwas"  
published: 2023-08-27  
updated: 2023-08-28  
canonical: https://www.mindstick.com/forum/159683/what-is-a-classloader  
category: "javascript"  
tags: ["c#", "javascript", "java"]  
reading_time: 2 minutes  

---

# What is a ClassLoader?

What is a [ClassLoader](https://www.mindstick.com/interview/2300/what-is-classloader)?

## Replies

### Reply by Aryan Kumar

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:

1. 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

2. Load the class file into memory. The class loader reads the class file into memory and parses it.
3. Link the class with other classes. The class loader links the class with other classes that it depends on.
4. 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.


---

Original Source: https://www.mindstick.com/forum/159683/what-is-a-classloader

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
