X848: Using Setter Methods 2

For this problem you will have access to the following class:

public class Ball{
  private int diameter;
  private String color;

  public void setDiameter(int d){
    diameter = d;
  }

  public void setColor(String c){
    color = c;
  }


}

For this problem, a Ball object has been created but diameter and color variables don't have any values. Using the ball object created, set diameter to 3 and color to "Blue".

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.