Question: Java, class inheritance. 1. Use the following UML Class diagrams to create a class Vehicle and its subclass Car Vehicle make : String - model
1. Use the following UML Class diagrams to create a class Vehicle and its subclass Car Vehicle make : String - model : String - year: int + Vehicle(String, String, int) + getMake() : String + getModel(): String + getYear(): int setMake(String) :void +setModel(String) : void +setYear(int): void Car - numberOfWheels int - numberOfDoors: int +Car(String, String, int, int, int) +getNumberOfWheels (): int +getNumberOfDoors(): int +setNumberOfWheels(int) void +setNumberOfDoors(int) void 2. Create tester classes for both your Vehicle and Car, VehicleTester and CarTester a. For each tester i. Instantiate an object of the class using the constructor ii. Test the getter methods using System.out.println() to display attributes ii. Test the setter methods by modifying values for the attributes iv. Verify setter methods work using System.out.println() to display attributes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
