blob: 319b8eb82514fc054c952ca3064bcf1573590b6b [file] [log] [blame]
import java.util.*;
public class CollectionTest {
public static void main(String[] args) {
int size;
HashSet collection = new HashSet();
// @formatter:off
String str1 = "Yellow",
str2 = "White",
str3 = "Green",
str4 = "Blue";
// @formatter:on
Iterator iterator;
// @formatter:off
collection.add(str1);
collection.add(str2);
collection.add(str3);
// @formatter:on
collection.add(str4);
iterator = collection.iterator();
while (iterator.hasNext()) {
System.out.print(iterator.next() + " ");
}
}
}