A a = new A(String,int)

解决方案 »

  1.   

    既然是A->B->C这样的继承关系。
    在构造函数中使用super调用的也只是B的构造函数。
    同样道理,B的构造函数也会调用A的构造函数。
    我想,否则编译都通不过的。
      

  2.   

    不用特意调,类C在new 的时候,已经执行了父类的构造函数。如果特意调用的话 super.构造函数名称就可以了。
      

  3.   

    补充:执行类C的构造函数时候自动调用父类的构造函数。既 c->b->a
      

  4.   

    执行类C的构造函数时候自动调用父类的构造函数
    构造顺序为A-B-C
      

  5.   

    class A
    {
        A()
    {
         System.out.println("this is A.");
    }
    }class B extends A
    {
    B()
    {
    System.out.println("this is B.");
    }
    }public class MyApp extends B
    {
        public static void main(String args[])
        {
         MyApp m=new MyApp();
        }
    }
    ///////////////////////////////////////////
    输出是:this is A. 
            this is B.