Class loading mechanism
There are three kinds of loading mechanisms for the class loading mechanism of the JVM.
- Overall responsibility: the so-called overall responsibility means that when a classloader is responsible for loading a class , the other class that it relies on and references is loaded by the ClassLoader, unless you explicitly use another classloader to load
- Parent class Delegate: The so-called parent class delegate is to let the parent ClassLoader attempt to load the class, and only load it from its own classpath if the parent ClassLoader fails to load
- Caching mechanism: The caching mechanism ensures that all loaded classes are cached, and when a class is used in the program , the ClassLoader first looks for the class from the cache . Only when the class is not present in the cache does the system re-read the corresponding binary data for that type and convert it to a class object and into the cache
The axe relationship in the ClassLoader is not a parent-child relationship in the inheritance, it refers to the relationship of the class loader instance
And look back on the 19th day of Java