Question: Use an Object Array to mimic the data structures of ArrayList. On these functions. Requirement: ** * Inserts all of the elements in the specified

 Use an Object Array to mimic the data structures of ArrayList. On these functions.

 

Requirement:

**

* Inserts all of the elements in the specified student.SimpleArrayList into this

* list at the specified position. Shifts the element currently at that

* position (if any) and any subsequent elements to the right (increases

* their indices). The new elements will appear in this list in the order

* that they are returned by the specified student.SimpleArrayList's iterator. The

* behavior of this operation is undefined if the specified student.SimpleArrayList

* is modified while the operation is in progress.

*

* @param index

* index at which to insert the first element from the specified

* student.SimpleArrayList

* @param c

* student.SimpleArrayList containing elements to be added to this list

* @return true if this list changed as a result of the call

*/

boolean addAll(int index, SimpleArrayList c);

 

/**

* Inserts the specified element at the specified position in this list

* (optional operation). Shifts the element currently at that position (if

* any) and any subsequent elements to the right (adds one to their

* indices).

*

* @param index

* index at which the specified element is to be inserted

* @param element

* element to be inserted

*/

void add(int index, E element);

Step by Step Solution

3.46 Rating (143 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To mimic the data structures of ArrayList using an Object Array and implement the provided functions we can create a class called SimpleArrayList and ... 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!