摘要: Student类: public class Student { public void study(){ System.out.println("好好学习,天天向上"); } } View Code Teacher类: public class Teacher { public void teac 阅读全文
posted @ 2020-06-21 21:38 硬盘红了 阅读(146) 评论(0) 推荐(0) 编辑
摘要: public class ReflectTest { public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { Ar 阅读全文
posted @ 2020-06-21 21:02 硬盘红了 阅读(139) 评论(0) 推荐(0) 编辑
摘要: public class ReflectDemo04 { public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, Invo 阅读全文
posted @ 2020-06-21 20:52 硬盘红了 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Method[] getMethods() 返回包含一个数组 方法对象反射由此表示的类或接口的所有公共方法类对象,包括那些由类或接口和那些从超类和超接口继承的声明。 public class ReflectDemo03 { public static void main(String[] args) 阅读全文
posted @ 2020-06-21 17:06 硬盘红了 阅读(211) 评论(0) 推荐(0) 编辑
摘要: public class ReflectDemo02 { public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, Invo 阅读全文
posted @ 2020-06-21 15:24 硬盘红了 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Field[] getFields() 返回包含一个数组Field对象反射由此表示的类或接口的所有可访问的公共字段类对象。 public class ReflectDemo01 { public static void main(String[] args) throws ClassNotFound 阅读全文
posted @ 2020-06-21 15:15 硬盘红了 阅读(544) 评论(0) 推荐(0) 编辑