1. package Day02_Demo.Demo04;/*
    2. @create 2020--12--23--16:16
    3. */
    4. import org.junit.Test;
    5. /**
    6. * 演示拓展类加载器,项目/bin
    7. */
    8. public class ClassLoaderDemo3 {
    9. //jdk中固定的配置信息,sun.boot.class.path用于引导类的加载器所加载的内容
    10. @Test
    11. public void test1() {
    12. String paths = System.getProperty("java.class.path");
    13. String[] str = paths.split(";");
    14. for (String s : str) {
    15. System.out.println(s);
    16. }
    17. }
    18. @Test
    19. //确定拓展类的加载器,类型:launcher$ExtClassLoader
    20. public void test2() {
    21. ClassLoader parent = ClassLoaderDemo3.class.getClassLoader().getParent();
    22. System.out.println(parent);
    23. }
    24. }