Test a very basic, pre-Java 1.5 for loop
*/ public void testForLoop(PrintStream out) throws IOException { List list = getList(); // initialize this list elsewhere for (Iterator i = list.iterator(); i.hasNext(); ) { Object listElement = i.next(); out.println(listElement.toString()); // Do something else with this list object } } /** *Test a very basic, Java 1.5 for/in loop
*/ public void testForInLoop(PrintStream out) throws IOException { List list = getList(); // initialize this list elsewhere for (Object listElement : list) { out.println(listElement.toString()); // Do something else with this list object } } /** *Test a simple array iteration
*/ public void testArrayLooping(PrintStream out) throws IOException { int[] primes = new int[] { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29 }; // Print the primes out using a for/in loop for (int n : primes) { out.println(n); } } /** *Test an object array iteration
*/ public void testObjectArrayLooping(PrintStream out) throws IOException { List[] list_array = new List[3]; list_array[0] = getList(); list_array[1] = getList(); list_array[2] = getList(); for (List l : list_array) { out.println(l.getClass().getName()); } } /** *Show list position in a loop (not possible with for/in)
*/ public void determineListPosition(PrintStream out, String[] args) throws IOException { List