Class loading mechanism: the virtual machine described class data from the class file is loaded into memory, and verify the data, and converts parsing initialization, forming Java type can be used as a virtual machine.
Class load
loading
1. Obtain a binary stream of bytes from the file Class
dynamic structure 2. When the byte stream structure into a static method of operating zone
3. java.lang.Class objects in memory is generated representative of the Class as a method of such access entry region.
Connection
Verification: Verify information byte stream Class file contains JVM meets the requirements, and to ensure that no harm JVM own security.
Preparation: allocate memory for static variables and assign initial value
analysis: The constant pool of symbolic reference is converted to a direct reference
initialization
Parents benefit delegation model: it is a Java class as a class loader has together with a priority hierarchy. For example various class java.lang.Object, it exists in rt.jar, whichever class loader to load the class are ultimately assigned to the top in the model Bootstrap ClassLoader loading, so the Object class of the program class loader environments are the same class. Conversely, if there is no parent delegation model but by each class loader to load their own words, if you write the same name as a class java.lang.Object ClassPath and placed in a number of different systems that the Object class will emerge, program will be chaos. Therefore, if developers try to write a Java class with the same name rt.jar class library,
it can be compiled normally, but can never be loaded to run.