blob: 5290700e34f9d6fe5c76c320bf0500eec8007e80 [file] [log] [blame]
import java.util.*;
public class CollectionTest {
public static void main(String[] args) {
int size;
HashSet collection = new HashSet();
// The following fragement must not be formatteed
String str1 = "Yellow",
str2 = "White",
str3 = "Green",
str4 = "Blue";
// end of fragment
Iterator iterator;
// do not format the following:
collection.add( str1 );
collection.add( str2 );
collection.add( str3 );
// end of fragment
collection.add(str4);
iterator = collection.iterator();
while (iterator.hasNext()) {
System.out.print(iterator.next() + " ");
}
}
}