I need some help on the homework on interfaces,inheritance, and polymorphism. The following 4 are what I needhelp writing the code on.
DataContainer is the interface
OneEndContainer and TwoEndsContainer are the classes thatimplements the interface
OrderedContainer extends TwoEndsContainer
The below parts are part of the prompt for theexercise. NO IMPORTS PLEASE!
Interface Task:
OneEndContainer Class Task:
Define a classcalled OneEndContainer thatimplements DataContainer using dataArray asdiscussed above. OneEndContainer has the followingattributes:
The class also has the followingconstructors:
The toString method of the interfaceis implemented as:
TwoEndsContainer Class Task
Define theclass TwoEndsConatiner thatimplements DataContainer using some kind of array as anunderline storage structure. The class has the followingattributes:
The class also has the followingconstructors:
Note that the add andremove methods should be implemented as described earlier.
OrderedContainer Class Task
The following diagram depicts the class hierarchies we will implement in this exercise. OneEndContainer DataContainer TwoEndsContainer OrderedContainer
Empty OneEnd Container After the first addition After 2 more additions After the first remove After the next removal After 2 more additions After one removal John John John John John John Adams Adams Abrham Abrham Quency Licoln
Empty TwoEnds Container After the first addition After 2 more additions After the first remove After the next removal After 2 more additions After a remove John John Admas Quency Quency Abrham Adams Quency Abrham Licolon Quency icoin
I need some help on the homework on interfaces, inheritance, and polymorphism. The following 4 are what I need help writ
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am