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

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

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 Programming Questions!