Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java How To Program Late Objects Version

Authors: Paul Deitel, Deitel & Associates

8th Edition

0136123716, 9780136123712

More Books

Students also viewed these Programming questions

Question

Outline the four functions and two attitudes in Jungs psychology.

Answered: 1 week ago