*
One, class loading mechanism
Running: Java HelloWorld
Bootstrap Loader (startup ClassLoader)--Auto load-->extended Loader (Standard extension class loader)
--Auto Load-->appclass loader (System ClassLoader)
Finally, Appclass loader loads the HelloWorld class
There are three ways to load a class:
1, the JVM initializes the load when the command line starts
2,class.forname () method dynamic loading
3,classloader.loadclass () Dynamic loading
Only 2, static initialization blocks of the class are executed
Only 2 and 3 do not execute static initialization blocks of the class
II, JDK and JRE
JDK: Contains Java development kits, development tools, which will compile. java into a. Class for Java Developers
JRE: A Java runtime environment that only runs files compiled as. class, Containing bin files (which can be seen as JVMs) and Lib class libraries, for Java program users.
The JVM interprets the. Class for execution on the local operating system for cross-platform
*
Java Fundamentals 1