超类型构造函数错误

时间:2016-02-20 16:20:55

标签: java constructor supertype

我收到以下错误消息,有人可以看到为什么吗?

  

错误:(21,38)错误:在超类型之前无法引用colourMatch   构造函数被称为

public class Guess {

    Colour[] pegs;
    int correct;
    int colourMatch;


    public Guess(Colour[] pegs, int correct, int colourMatch) {
        //super(pegs);
        this.pegs = pegs.clone();
        this.correct = correct;
        this.colourMatch = colourMatch;
    }

    public Guess(Colour[] currentGuess, Colour[] solution) {
        this(currentGuess, solution, colourMatch);//error message on colourMatch<

    }

    public Colour getPeg(int i) {
        return pegs[i];
    }
}

0 个答案:

没有答案