// Small client program that uses ArrayIntList import java.util.*; public class ArrayIntListClient { public static void main(String[] args) { ArrayIntList list = new ArrayIntList(); list.add(1); list.add(2); list.add(3); list.add(4); int product = 1; Iterator itr = list.iterator(); while (itr.hasNext()) { int n = itr.next(); product *= n; if (n % 3 == 0) { itr.remove(); } } System.out.println(product); // After implementing the Iterable interface, we can // now use a for each loop! for (int n : list) { System.out.println(n); } } }