// CSE 143, Winter 2009, Marty Stepp // This client program uses and tests our LinkedIntList class. public class UseList { public static void main(String[] args) { // add four integers, then print the list LinkedIntList list = new LinkedIntList(); list.add(42); list.add(-3); list.add(17); list.add(29); System.out.println("After adding 4 elements:"); for (int i = 0; i < 4; i++) { System.out.println("element " + i + " = " + list.get(i)); } // remove two integers (one later in the list, then the front one) list.remove(17); list.remove(42); System.out.println("After removing 2 elements:"); for (int i = 0; i < 4; i++) { System.out.println("element " + i + " = " + list.get(i)); } } }