一: Object object = new Object(); 二: public static void main(String[] args) throws InstantiationException, IllegalAccessException, ClassNotFoundException { //可以通过映射的方式来获取 DemoTest2 myobject = (DemoTest2)Class.forName("DemoTest2").newInstance(); myobject.findAll(); }
时间: 2024-10-05 05:20:48