|
|
Bus.java |
|
View full source |
|
|
TestBus.java |
|
View full source |
| Question 1 |
| When running TestBus, how many copies of the variable numInGarage are created in the memory? |
| Question 2 |
| In TestBus.java, what will happen if we add the statement
Bus bus3 = new Bus(true);
after
bus2 = new Bus(true);
on line 25. |
| Question 3 |
| If we change
Bus.askNumberInGarage();
to
bus1.askNumberInGarage();
will the program still compile? |
| Question 4 |
| A client programmer tries to create a subclass that extends Bus. He wants to increase the garageCapacity to 3. Can he accomplish this? |
