i

JAVA Complete Course

Class Loading Process by Class Loaders

Class Loader is responsible for dynamic class loading functionality. Classes will be loaded by this component. There are three types of class loaders which are taking part in process:

1. Bootstrap class loader is the loader with the highest priority and it loads classes from bootstrap classpath, which is only rt.jar

2. Extension class loader is the one which loads classes from the ext folder, such as jre/lib

3. Application class loader is an application level loader which is responsible for loading application classpath, such as environment variables and so on.

Linking is the process which contains three sub processes:

1. Verify is checking if the generated bytecode is valid and if it is not, then we are getting verification error

2. Prepare is the process which memory for all static variables and assign them default values

3. Resolve is the process which from the Method Area will change all symbolic references with the original ones.

And the last step in class loading process is the initialization, where static blocks will be executed and all static variables will be assigned with the original values.