Could a main() method create a Car object?

A good answer might be:

Sure, as long as it had access to the class definition.

Using a Car Object

To see if the design for the class Car is correct, let us try to use it in a program. Here is a short program that uses a Car object for calculating miles per gallon:

import Car ;  // assume that a class definition is available

class MilesPerGallon
{
  public static void main( String[] args )
  {
    Car car = new Car( ______________, ____________, __________ );

    System.out.println( "Miles per gallon is " + ______________ );
  }
}

The program creates an object of the class Car, and saves a reference to it in the variable car.


QUESTION 3:

Fill in the blanks so that the program prints out the miles per gallon for a car with:

(Look at the previous page to see the constructor).