package Day02_Demo.Demo04;/*
@create 2020--12--23--16:16
*/
import org.junit.Test;
/**
* 演示拓展类加载器,加载的内容是jre/lib/ext
*/
public class ClassLoaderDemo2 {
//jdk中固定的配置信息,sun.boot.class.path用于引导类的加载器所加载的内容
@Test
public void test1() {
String paths = System.getProperty("java.ext.dirs");
String[] str = paths.split(";");
for (String s : str) {
System.out.println(s);
}
}
@Test
//确定拓展类的加载器,类型:launcher$ExtClassLoader
public void test2() {
ClassLoader parent = ClassLoaderDemo2.class.getClassLoader().getParent();
System.out.println(parent);
}
}