是不是this(a, b, c);这个没指定是哪个构造方法啊。this()setVar(a,b,c)就对了么

解决方案 »

  1.   

    this()这是什么语法,从来没见过!
      

  2.   

    this()方法不是调用其他不同的构造方法么,this(a, b, c);不就刚好调用第4行的public void setVar(int a, int b, float c)。不知道是不是这样
      

  3.   

    this(a, b, c); Error .
      

  4.   

    >>>this()方法不是调用其他不同的构造方法么,this(a, b, c);不就刚好调用第4行的public void setVar(int a, int b, float c)。不知道是不是这样
     setVar并不是构造方法。构造方法的名字与类名字相同并且没有任何返回值,在你的例子中,如果要指定一个构造函数的话,应该具有这样的形式:        public MethodOver()
      - or -
            public MethodOver(带参数)
      

  5.   

    即使你书写了一个构造函数像这样:  public MethodOver(int a,int b,float c)你也不能在一个普通的函数(指非构造函数)中使用this(a,b,c)来企图引起对应构造函数的调用,如果你非要如此,编译的时候,编译器会告诉你:         call to this must be first statement in constructor
      

  6.   

    this(a, b, c);?????????
    没见过