Question: Assignment 9: Inheritance (Chapter 10) Using the solution to your assignment 5, do the following: Create a sub class that inherits everything from your base

 Assignment 9: Inheritance (Chapter 10) Using the solution to your assignment

Assignment 9: Inheritance (Chapter 10) Using the solution to your assignment 5, do the following: Create a sub class that inherits everything from your base class. (For example, if Car is the base class then SportsCar could be your sub class) [1 point] Provide at least one additional attribute to your subclass [1 point] o Create gettter/setter methods for it. Create a default constructor for the subclass, that uses super to call the base class default constructor. [1 point o It should set all attributes in the subclass as well as the super class to default values .Create a parameterized constructor for the subclass, that uses keyword super to pass the inherited parameters to the base class. [1 point] o It should set all attributes in the subclass as well as the super class to the values that are passed in to the constructor. Override the display0 method to print out all the instance variable values from the base class, and also from the sub class. [1 point] In your main method, create 2 new object using your subclass, set the data, and call the display method. Create one object using the no-arg (default) constructor of your sub-class. [1 point] Call the set methods to set all attribute data associated to that object. Call the display method for that object Create one object using the parameterized constructor of your sub-class. [1 point] - Call the display0 method for this object too

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!