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


 In object-oriented programming, inheritance allows an existing class to be "extended" tocreate specialized subclasses. We call each subclass a "derived" or "child" classand the existing class the "parent" class. In this lab, you are

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

1 Expert Approved Answer
Step: 1 Unlock

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

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!