/* * Kyle Pierce * CSE 143 * * Client code for the ArrayIntList class */ public class ArrayIntListClient { public static void main(String[] args) { ArrayIntList list1 = new ArrayIntList(); ArrayIntList list2 = new ArrayIntList(); // we write an add method to make things easier list1.add(11); list1.add(-2); list1.add(1000); System.out.println(list1); // we add another add method list2.add(11); list2.add(1000); list2.add(1, -3); // this is the new one System.out.println(list2); // we add indexOf, contains, and remove methods System.out.println(list1.indexOf(-2)); // should be 1 list1.remove(1); // removes the value at index 1 System.out.println(list1.contains(-2)); // should be false // empty out the two lists list1.clear(); list2.clear(); // make some lists for testing the addAll method list1.add(1); list1.add(2); list1.add(3); list2.add(4); list2.add(5); list2.add(6); System.out.println(list1); System.out.println(list2); // see what the addAll method does list1.addAll(list2); System.out.println(list1); } }