随笔分类 -  JAVA反射笔记

摘要:方法的反射: 1.获取A类中的print(int,int)方法: ①要获取一个方法就是获取类的信息,获取类的信息首先要获取类的类类型 A a1=new A(); Class c= a1.getClass(); ②获取方法 由名称和参数列表来决定,getMethod获取的是public方法,getDelcaredMethod获取自己声明的方法 Method m =c.getMetho... 阅读全文
posted @ 2018-10-29 13:09 9529
摘要:来源慕课网 阅读全文
posted @ 2018-10-29 10:53 9529