没有试过调用构造函数,你试试将你的构造函数private,然后使用静态的factory方法生成看行不行

解决方案 »

  1.   

    Class cls=Class.forName("test.reflect.A");  //import class
    Constructor cst=cls.getConstructor(new Class[]{String.class}); //get the constructor
    Object obj=cst.newInstance(new Object[]{new String("invoke Construct method!")}); //get a new instance
      

  2.   

    Class cls=Class.forName("test.reflect.A");  //import class
    Constructor cst=cls.getConstructor(new Class[]{String.class}); //get the constructor
    Object obj=cst.newInstance(new Object[]{new String("invoke Construct method!")}); //get a new instance
      

  3.   

    请问flyforlove,产生的Object是不是还要通过下塑造型才能得到特定的类实例
      

  4.   

    http://dev.csdn.net/article/58/58798.shtm