注意:在执行第2个步骤的时候,系统对直接父类的初始化步骤也遵循初始化步骤1-3
ClassLoader:是负责加载类的对象



static ClassLoader getSystemLoader():返回用于委派的系统类加载器
ClassLoader getParent():返回父类加载器进行委派
package Demo;
public class ClassLoaderDemo {
/*
static ClassLoader getSystemLoader():返回用于委派的系统类加载器
ClassLoader getParent():返回父类加载器进行委派
*/
public static void main(String[] args) {
// static ClassLoder getSystemLoader():返回用于委派的系统类加载器
ClassLoader c = ClassLoader.getSystemClassLoader();
System.out.println(c);//AppClassLoader
// ClassLoader getParent():返回父类加载器进行委派
ClassLoader c2 = c.getParent();
System.out.println(c2);//PlatformClassLoader
ClassLoader c3 = c2.getParent();
System.out.println(c3);//null
}
}
