X936: Writing A Mutator

For this question, take a look at the Ball class defined below.

public class Ball
{
    private boolean isInflated;

    public Ball()
    {
        this.isInflated = false;
    }

    public Ball(boolean r)
    {
        this.isInflated = r;
    }

    public boolean isInflated()
    {
        return isInflated;
    }
}

Create a mutator method for the boolean field isInflated called setInflated.

Your Answer:

Feedback

Your feedback will appear here when you check your answer.