Class--2019-04-14
获取class对象,有三种方法:
1.通过类名.class直接访问
Class c = Integer.class;
2.通过Class.forName(类名)函数获取
Class c = Class.forName("Integer");
3.通过对象.class获取
Integer n = new Integer ();
Class c = n.getClass();
获取class对象,有三种方法:
1.通过类名.class直接访问
Class c = Integer.class;
2.通过Class.forName(类名)函数获取
Class c = Class.forName("Integer");
3.通过对象.class获取
Integer n = new Integer ();
Class c = n.getClass();