public class ClassMain { public ClassMain(){ } public static void main(String args[]){ //创建不带参数的对象 //ReflectClass rc1=(ReflectClass) ClassMain.getInstance("com.jijing.classDemo.ReflectClass"); //System.out.println("ReflectClass111="+rc1); System.out.println("******************************"); ReflectClass rc2=(ReflectClass) ClassMain.getInstance("com.jijing.classDemo.ReflectClass", new Class[]{Integer.TYPE,String.class,MyClass.class}, new Object[]{20,"我是ReflectClass",new MyClass("我是MyClass")}); System.out.println("ReflectClass222="+rc2); } |