Design your own set of classes that illustrate inheritance.
- Create an abstract class
- It must have one or more properties
- It must have one or more abstract methods.
- It must have one or more concrete methods.
- It must have a default constructor.
- It must have the appropriate accessor and modifier methods.
- It must have an overridden toString method.
- Create another class that is a child class of your abstract class.
- It must have one or more of its own properties. DO NOT shadow (i.e. duplicate) the properties of its parent class.
- It must have a default constructor and the appropriate accessor and modifier methods.
- It must override and implement the abstract methods of its abstract parent class.
- It must have at least three, non-inherited "interesting" methods one of which must be a final method.
- It must implement the Comparable interface
- It must have overridden toString and equals methods.
- Create
a class that is a child to the concrete class above.
- It must override one or more of the methods in its parent class.
- It must have a default constructor.
- It must have one or more "other" constructors.
Use this() and super() where possible.
- It must implement the Comparable interface
- It must have overridden toString and equals methods.
- Write a client class named InheritanceTest.
- In this client class, instantiate an object from each of the two concrete classes.
- Write code that makes use of at least 4 of the methods included in the various classes.
Your program must follow the class Coding
Standards.
Preconditions:
You must hand in the following on separate pages
stapled in this specified order:
- Neatly draw a class hierarchy chart illustrating the relationships between the first three classes as well as the Comparable interface. Use the correct types of lines and arrowheads.
- The source code for the InheritanceTest class.
- The source code for the abstract class.
- The source code for the concrete class that is a child of the abstract class.
- The source code for the concrete class that is a child of the other concrete class.
- Runtime output that is easy for the instructor to read.