import java.util.ArrayList; public class ArrayListADT { public static void printArray(ArrayList numsList, int numOfElem) { int i = 0; for (i = 0; i < numOfElem; ++i) { System.out.print(numsList.get(i)); System.out.print(\" \"); } System.out.println(\"\"); } public static void main (String [] args) { ArrayList numsList = new ArrayList(); int numOfElem = 4; numsList.add(new Integer(101)); numsList.add(new Integer(200)); numsList.add(new Integer(103)); numsList.remove(1); //remove 200 at index 1 as index starts from 0 numsList.add(0,new Integer(100)); //add 100 at index 0 so 101 will move to index 1 numsList.add(2,new Integer(102)); // add 102 at index 2 so 103 will move down to index 3 printArray(numsList, numOfElem); return; } } Output Solution import java.util.ArrayList; public class ArrayListADT { public static void printArray(ArrayList numsList, int numOfElem) { int i = 0; for (i = 0; i < numOfElem; ++i) { System.out.print(numsList.get(i)); System.out.print(\" \"); } System.out.println(\"\"); } public static void main (String [] args) { ArrayList numsList = new ArrayList(); int numOfElem = 4; numsList.add(new Integer(101)); numsList.add(new Integer(200)); numsList.add(new Integer(103)); numsList.remove(1); //remove 200 at index 1 as index starts from 0 numsList.add(0,new Integer(100)); //add 100 at index 0 so 101 will move to index 1 numsList.add(2,new Integer(102)); // add 102 at index 2 so 103 will move down to index 3 printArray(numsList, numOfElem); return; } } Output.