反射 public class hello1 { /**三种方式获取class对象*/ @Test public void test1() throws Exception { Class<Emps> c1 = Emps.class; Class c2 = Class.forName("com.blb.pojo.Emps"); Class c3 = new Emps().getClass(); } @Test /**调用实体类的无参构造*/ public void test2() throws Exception {