Complete the code to declare a class named Car.
public class [1] { }
The class name should be Car to model a car.
Complete the code to add a field for the car's color.
public class Car { private [1] color; }
The color of a car is best represented as a String because it is text.
Fix the error in the constructor to set the car's color.
public class Car { private String color; public Car(String [1]) { this.color = color; } }
The constructor parameter must be named color to match the assignment this.color = color;.
Fill both blanks to add a method that returns the car's color.
public class Car { private String color; public String [1]() { return [2]; } }
The method name to get the color is getColor, and it returns this.color to access the field.
Fill all three blanks to add a method that sets the car's color.
public class Car { private String color; public void [1](String [2]) { this.[3] = [2]; } }
The setter method is named setColor, it takes a parameter newColor, and assigns it to the field color.
