super type constructor error

50 views Asked by At

I get the following error message, can anyone see why please?

Error:(21, 38) error: cannot reference colourMatch before supertype constructor has been called

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

There are 0 answers