|Due By (Pacific Time)
||12/01/2016 08:00 am
Using the solution to your assignment 6 (or my solution), 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]
- 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]
- 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]
- 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 display() 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 display() method for this object too