首页 > 其他 > 详细

48.反射

时间:2020-06-29 01:05:07      阅读:84      评论:0      收藏:0      [点我收藏+]

1.类加载器

1.1类加载

技术分享图片

 

 技术分享图片

 

 1.2类加载器

技术分享图片

 

 技术分享图片

    public static void main(String[] args) {
//        static ClassLoader getSystemClassLoader() 返回用于委派的系统类加载器。
//        ClassLoader getParent() 返回委托的父类加载器。(返回父类加载器进行委派)
        ClassLoader c1 = ClassLoader.getSystemClassLoader();//返回用于委派的系统类加载器。
        System.out.println(c1);//AppClassLoader
        ClassLoader c2 = c1.getParent();
        System.out.println(c2);//ExtClassLoader
        ClassLoader c3 = c2.getParent();
        System.out.println(c3);//null
    }
}

2.反射

2.1反射概述

技术分享图片

 

 技术分享图片

 

 2.2获取Class类的对象

 

48.反射

原文:https://www.cnblogs.com/luzhanshi/p/13205671.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!