/* Loops17.java CIS 160 David Klick 2010-09-11 Demonstrates for loop iterating over a collection */ public class Loops17 { public static void main(String[] args) { // set up a collection of String objects // - using an array in this case String[] names = { "Greg", "Greg", "Andrew", "Jason", "Alex", "Marie" }; // display all names in collection using a for loop System.out.println("The names in the collection are:"); for (String s: names) System.out.println(" " + s); } }