Complete the code to declare a class named Car.
public class [1] { // class body }
The class name should be Car to match the declaration.
Complete the code to create an object of class Car named myCar.
Car [1] = new Car();The variable name for the object should be myCar as specified.
Fix the error in the constructor declaration of class Car.
public class Car { public [1]() { System.out.println("Car created"); } }
Constructors have no return type and must have the same name as the class, here Car.
Fill both blanks to define a method that returns the car's model name.
public class Car { private String model; public [1] [2]() { return model; } }
The method should return a String and be named getModel to follow naming conventions.
Fill all three blanks to create a constructor that sets the model name.
public class Car { private String model; public [1]([2] model) { this.[3] = model; } }
The constructor name is Car, it takes a String parameter named model, and assigns it to the field this.model.
