8. Build a UML inheritance diagram with the following information:
AirVehicle, Vehicle, WaterVehicle, LandVehicle, Auto
9. Consider the classes shown below:
public class Parent
{
public void doSomething() {/* Implementation not shown */}
}
public class Child extends Parent
{
public void doAnotherThing() {/* Implementation not shown */}
}
Which lines in the following code will compile without error? Explain your answer.
Child kid = new Child();
kid.doSomething(); // line 1
kid.doAnotherThing(); // line 2
a) Line 1 only
b) Line 2 only
c) Lines 1 and 2
d) Neither line will compile without error