Question: Java Program: Create a class named Car that contains data fields for the manufacturer, model, and manufacture year, e.g. Ford, Escape, 2015. Include get and

Java Program:

Create a class named Car that contains data fields for the manufacturer, model, and manufacture year, e.g. Ford, Escape, 2015. Include get and set methods for these fields. The class also includes a display() method that displays all the car data. Next, create a subclass named RaceCar, which contains an additional field that holds the number of races in which the car has competed and additional methods to get and set the new field. Override the parent class display() method to include RaceCar information. Next create a subclass named PrivateCar which contains an additional field that holds the owners name and additional methods to get and set the new field. Override the parent class display() method to include PrivateCar information. Write an application that demonstrates using objects of each class. Save the files as Car.java, RaceCar.java, PrivateCar.java, and DemoCar.java. At the beginning of the program add comments including program description.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!