X846: Calling Super With Parameters

Below is a ChessPiece class that we will be using as a superclass for a Queen subclass.

public class ChessPiece
{
    // the location of this chess piece in our microworld
    private int row;
    private int column;

    public ChessPiece(int r, int c)
    {
        row = r;
        column = c;
    }
}

Below, write the constructor for the Queen subclass. You'll need to call super, but calling super() without parameters won't work. You'll need to pass the row and column values through to the superclass.

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.