A good answer might be:See below. | |
Constructors used inside a ConstructorThe 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.
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 |