// CSE 143, Winter 2012 // This client program tests our ArrayIntList by adding and removing several // elements. We viewed the state of the list using the jGRASP debugger. public class ListClient { public static void main(String[] args) { ArrayIntList list = new ArrayIntList(); list.add(42); list.add(-7); list.add(95); for (int i = 0; i < list.size(); i++) { System.out.println("element " + i + " = " + list.get(i)); } System.out.println(); list.add(1, 111); list.add(3, 333); list.add(0, 99999999); for (int i = 0; i < list.size(); i++) { System.out.println("element " + i + " = " + list.get(i)); } System.out.println(); list.remove(2); list.remove(4); for (int i = 0; i < list.size(); i++) { System.out.println("element " + i + " = " + list.get(i)); } } }