Question: Create a new class named SimArrayList that simulates the operations of the Java built-in array list. The SimArrayList class has the following fields and

Create a new class named SimArrayList that simulates the operations of the Java built-in array list. The SimArrayList class has the following fields and methods: 1. private T[] data-the internal storage. The initial size is 10. 2. public void add(T value) - Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). 3. public T get(int index) - return the element at specified position in the list. 4. public T remove(int index) - Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices). 5. Other fields and methods (if any) should be set with the "private" modifier. 6. public static void main(String[] args) - use the following code to test your SimArrayList: public static void main(String[] args) { char[] A 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'); SimArrayList list = new SimArrayList (); for (char n: A) { } list.add(0, n); for (int i=0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
