Complete the code to declare a class named Car.
public class [1] {}
The class name should start with a capital letter and match the intended object, here 'Car'.
Complete the code to create an object of class Car.
Car myCar = new [1]();To create an object, use the class name with 'new'. Here, 'Car' matches the class.
Fix the error in the method to return the car's speed.
public int getSpeed() {
return [1];
}Use 'this.speed' to refer to the instance variable speed inside the method.
Fill both blanks to define a constructor that sets the car's speed.
public [1](int [2]) { this.speed = speed; }
The constructor name must match the class name 'Car'. The parameter name is 'value' to assign to the instance variable 'speed'.
Fill all three blanks to create a method that increases the car's speed by a given amount.
public void [1](int [2]) { this.speed [3] amount; }
The method name is 'accelerate', parameter is 'amount', and '+=' adds the amount to speed.