|
Are actual car objects part of the definition of Fleet? A good answer might be:No---the definition for Fleet says that a Fleet object has two variables that refer to Car objects. | |
Instance Variables for FleetThe long-lasting state of a Fleet object will be held in its two instance variables---which refer to Car objects. Pretend that Fleet has been defined. The documentation might look like this: Fleet The constructor for a fleet will build the two cars it consists of. Since each car needs three values, the constructor for the fleet will need a total of six values. (There are other more elegant ways to do this, but let us do it this way for now.) Here is a short main() that constructs a fleet:
| |
QUESTION 5:Fill in the blanks so that the Fleet object looks like this:
|