Question: We need to make code of IntegerList, UniqueList, SortedList, and RangeList In object-oriented programming, inheritance allows an existing class to be extended to create specialized



We need to make code of IntegerList, UniqueList, SortedList, and RangeList
In object-oriented programming, inheritance allows an existing class to be "extended" to create specialized subclasses. We call each subclass a "derived" or "child" class and the existing class the "parent" class. In this lab, you are given starter code for the parent class IntegerList. Your goal is to complete this class and then implement three subclasses: UniqueList, Sorted List, and RangeList. Each subclass modifies the behavior of IntegerList in a different way. Class Diagram Inheritance is represented in UML diagrams by an arrow that connects two classes. The arrow points from the child class to the parent class. The following is a UML diagram for IntegerList and its child classes: UniqueList -MIN CAPACITY = 2: int -array: int[] -size: int IntegerList +IntegerList() : ctor +IntegerList(int capacity): ctor +capacity (): int +add(int integer): void +indexOf(int integer): int +get(int index): int +insert(int index, int integer): void +remove(int index): int +size(): int +toString(): String +UniqueList() : ctor +UniqueList(int capacity): ctor +add (int integer): void +insert (int index, int integer): void RangeList Sorted List +Sorted List() : ctor +Sorted List (int capacity): ctor +add (int integer): void +insert(int index, int integer) : void +RangeList(): ctor +RangeList(int lowerBound, int upperBound): ctor +add (int lowerBound, int upperBound): void +remove(int lowerBound, int upperBound): void +insert(int index, int integer): void +add (int integer): void
Step by Step Solution
There are 3 Steps involved in it
Step 1 Program Plan IntegerList Class Class Declaration and Instance Variables Declare the IntegerList class Declare the following instance variables int array to store the list of integers int size t... View full answer
Get step-by-step solutions from verified subject matter experts
