The ClassLoader loads the bytecode file into memory and generates the corresponding Java.land.class object in the method area as a portal to the external access method area.
Class Loader hierarchy:
Boot class loader-------------extension classloader--------------------------Reference program ClassLoader-----------------custom class Loader
1, boot class loader load Jre/lib/rt.jar package load Core class Library
2. The extension loader is responsible for loading Jre/lib/ext/*.jar
3. Load our custom class with the program loader class
4. The custom loader is responsible for loading the specified class
Parent delegation:
Customize a Java.utils.HashMap class with the same package name as the class name, can it be compiled and passed? If the compilation passes, which of the HashMap classes is loaded, why?
Answer: Can be compiled by referencing Java HASHMAP Parent delegation first load Java
Parental delegation mechanism, when the class loader receives a request to load the class, regardless of whether it can load, first load the request to the parent class, if the father has a father, in the upward submission, until the top-level parent class, if the topmost load can be loaded on the load if not loaded, and so on to the son load, and so on, Report an exception if it is not yet loaded
Class loader architecture and parental delegation mechanism for Java