Create a superclass. It must have at least 2 instance variables It must have a default constructor,
Fantastic news! We've Found the answer you've been seeking!
Question:
Create a superclass.
- It must have at least 2 instance variables
- It must have a default constructor, and at least one parameter constructor.
- It must have the appropriate accessors, modifiers,toString() andequals() methods.
- It must have at least 2 other "interesting" methods
Create a subclass to the one above.
- It must have at least one of its' own instance variables
- It must have a default constructor, parameter constructor, and the appropriate accessor and modifier methods. The constructors must have explicit calls to the parent constructor usingsuper.
- It must override and implement one of the methods of its parent. This method may or may not use thesuper keyword.
- It must override thetoString() andequals() methods and use a call to the super's method.
- It must have at least two unique, non-inherited methods.
Create another subclass to the one above.
- It must have at least one of its' own instance variables
- It must have a default constructor, parameter constructor, and the appropriate accessor and modifier methods. The constructors must have explicit calls to the parent constructor usingsuper.
- It must override and implement one of the methods of its parent. This method may or may not use thesuper keyword.
- It must override thetoString() andequals() methods and use a call to the super's method.
- It must have at least two unique, non-inherited methods.
Create a "driver" class with amain method
- Create anArrayList of superclass objects
- Create 10 objects and add them to your ArrayList. They should include all 3 objects you have created above. At least 5 of the examples must demonstrate proper aliasing and/or cloaking.
Related Book For
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates
Posted Date: