摘要: public class reflectDemo { public static void main(String[] args) throws Exception { Scanner in = new Scanner(System.in);//-------------------------提醒用户输入 System... 阅读全文
posted @ 2018-05-30 00:57 Peter_Yu 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 1、通过getClass()方法:(通过对象) Class c1 = obj.getClass(); 2、通过对象实例方法获取对象:(通过对象) Class c2= obj.class; 3、类的全路径:(通过类名) Class c3 = Class.forName("package.classNa 阅读全文
posted @ 2018-05-30 00:18 Peter_Yu 阅读(501) 评论(0) 推荐(0) 编辑