It does dynamic class loading functionality It loads, links. and initializes the class file when it refers to a class for the first time at runtime, not compile time.
- Boot Strap
ClassLoader
– Responsible for loading classes from the bootstrapclasspath
, nothing butrt.jar
. Highest priority will be given to this loader. - Extension
ClassLoader
– Responsible for loading classes which are insideext
folder (jre\lib
). - Application
ClassLoader
–Responsible for loading Application LevelClasspath
, path mentioned Environment Variable etc.
- Verify – Bytecode verifier will verify whether the generated bytecode is proper or not if verification fails we will get the verification error.
- Prepare – For all static variables memory will be allocated and assigned with default values.
- Resolve – All symbolic memory references are replaced with the original references from Method Area.
All static variables will be assigned with the original values, and the static block will be executed.