public class ArrayIntListClient { public static void main(String[] args) { // construct ArrayIntList list1 // construct ArrayIntList list2 ArrayIntList list1 = new ArrayIntList(); ArrayIntList list2 = new ArrayIntList(); // add 1, 82, 97 to list1 list1.add(1); list1.add(82); list1.add(97); // We can print out the size of any ArrayIntList now, // but we still can't modify the size directly (which is good!) System.out.println("list1 size = " + list1.size()); System.out.println(list1.get(2)); //System.out.println(list1.get(5)); throws an IndexOutOfBoundsException System.out.println(list1.contains(82)); System.out.println(list1.contains(5)); // add 7, -8 to list2 list2.add(7); list2.add(-8); // adds all of the elements from list2 into list1 list1.addAll(list2); for(int i = 0; i < 10; i++) { list1.add(i); } // print list1 // print list2 System.out.println("list1 = " + list1); System.out.println("list2 = " + list2); } }