0% found this document useful (0 votes)
3 views2 pages

Java Class Loader Overview

The Class Loader subsystem in Java consists of three main processes: Loading, Linking, and Initialization. It involves reading .class files, verifying their correctness, and allocating memory for class variables, followed by initializing static variables. There are three types of class loaders: Bootstrap, Extension, and Application class loaders, each responsible for loading different sets of classes from specified directories.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Java Class Loader Overview

The Class Loader subsystem in Java consists of three main processes: Loading, Linking, and Initialization. It involves reading .class files, verifying their correctness, and allocating memory for class variables, followed by initializing static variables. There are three types of class loaders: Bootstrap, Extension, and Application class loaders, each responsible for loading different sets of classes from specified directories.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Class Loader subsystem

Loading Linking Initialization


Bootstrap class loader verify Initializatio
n
Extension class loader prepare

Application class loader Resolve

• Loading: The class loader reads the “.class” file from Hard disk and loads to RAM, generate the
corresponding binary data and save it in the method area. For each .class file, JVM stores following in
method area.
 Fully qualified name of the loaded class and its immediate parent class.
 Whether .class file is related to Class or Interface or Enum
 Modifier, variables and method information etc
• After loading .class file, JVM creates an object of type Class to represent this file in Heap memory.
• Linking : It ensures the correctness of .class file, whether this file is properly formatted and generated by a
valid compiler or not. JVM allocates the memory for class variables and initializing memory to default
values
Initialization: All static variables are assigned with their values defined in the code and static block(if any).
This is executed from top to bottom in a class and from parent to child in class hierarchy
Class Loader
Bootstrap class loader : Every JVM implementation should have bootstrap class loader, capable of loading trusted
classes. It loads core Java API classes present in JAVA_HOME/jre/lib directory

Extension class loader : It loads classes present in the extensions directory JAVA_HOME/jre/lib/ext or any other
directory specified by java.ext.dirs. System property

System or Application class loader: It is responsible to load classes from application class path

Class is loaded by
Bootstrap class loader Find
extension class loader
class
Load class Load class Class is loaded by
Find extension class loader
Extension class loader class

Load class Load class


Request to
Application class loader load a class

You might also like