import java.util.*; // needed for the Iterator interface. public class LinkedListTester { public static void main (String[] args) { LinkedList127 list = new LinkedList127(); System.out.println(list + " with size " + list.size()); list.append("Fi"); list.append("Fie"); list.append("Foe"); list.prepend("Foo"); System.out.println(list + " with size " + list.size()); list.delete(list.size()-1); System.out.println(list + " with size " + list.size()); LinkedList127 intlist = new LinkedList127(); System.out.println(intlist); intlist.append(3); System.out.println(intlist); intlist.prepend(2); System.out.println(intlist); intlist.append(4); System.out.println(intlist); intlist.append(5); System.out.println(intlist); intlist.append(6); System.out.println(intlist); intlist.prepend(1); System.out.println(intlist); intlist.append(7); System.out.println(intlist); intlist.append(8); System.out.println(intlist); intlist.append(9); System.out.println(intlist); System.out.println("entries #1, 2, and 8 == " + intlist.get(1) + ", " + intlist.get(2) + ", and " + intlist.get(8) ); Iterator iter = intlist.iterator(); Iterator iter2 = intlist.iterator(); System.out.println("next from iter1 = " + iter.next()); System.out.println("next from iter1 = " + iter.next()); System.out.println("next from iter2 = " + iter2.next()); System.out.println("next from iter1 = " + iter.next()); System.out.println("next from iter2 = " + iter2.next()); System.out.println("next from iter2 = " + iter2.next()); } }