A good answer might be:

See below.

Constructors used inside a Constructor

The constructor for Fleet is given (in its parameters) all the information in needs to build two cars. It uses the Car constructor for this (twice). The Car object references are kept safe in the instance variables of the Fleet objects.

class Fleet
{
  // data
  Car town;
  Car suv;

  // constructor
  Fleet( int start1, int end1, double gal1, 
         int start2, int end2, double gal2 )
  {
    town = new Car( start1, end1, gal1) ;
    suv  = new Car( start2, end2, gal2) ;
  }

  // method


}

class FleetTester
{
  public static void main ( String[] args)
  {
    Fleet myCars = new Fleet( 1000, 1234, 10, 777, 999, 20 );
  }
}

Usually you would just say that myCars is a Fleet that contains two Car objects.

Notice how the values given when the Fleet is constructed (in main()) match up with the parameters in the constructor in the class definition, and how that constructor carefully uses them with the constructor for Car.

QUESTION 7:

If a Fleet object is constructed, how many new objects will there be?

Click Here after you have answered the question