Labs
In this lab we will change our subclasses to use features of their superclasses.
This set of labs is short, but will be used in subsequent chapters to use other features of object-oriented programming.
- Change
Automobile,Truck, andBoatto pass arguments to parent class constructors usingsuper(). Remove any calls to setters. - Remove no-arg constructors from
Vehicle,Automobile,Truck, andBoat. Now when a user creates an instance of these classes, the user must supply all data. - Fix any compilation errors, and run
VehicleTestAppto verify your classes still work.
(Solution: Vehicle3.java, Automobile3.java, Truck3.java, Boat3.java, VehicleTestApp3.java)