Namespace class loader depth analysis and Case Study
Namespace relationship different class loader:
Classes in the same namespace are mutually visible.
Namespace child loader namespace contains all of the parent class loader. Thus by the sub-loaded by the class loader loads you can see the parent class. For example the system class loader to load a class can see the root class loader to load a class.
Loaded by the class loader can not see the parent child class loader loads.
If there is no direct or indirect parent-child relationship between two loaders, they are each loaded class is not visible to each other.
First, print the result is: System.out.println (clazz1 == clazz2); to load because loader1, loader2 to load MyPerson when parents are commissioned by the mechanism to request its parent class loader for the first time loader1 request parent class loader (the system class loader) to complete the loading; loader2 when the second load, the parent class loader request (system class loader) to load found MyPerson has been loaded, it is no longer reloaded , the result can be loaded directly back.
The reason for the false: ** If there is no direct or indirect parent-child relationship between two loaders, they are each loaded class is not visible to each other. ** and so loader1 loader2 are two different class loaders (different class loaders have different namespaces, however, the two different namespaces have the same class MyPerson).