Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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.
Step by Step Solution
★★★★★
3.47 Rating (154 Votes )
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started