How to Iterate over a Set/HashSet without an Iterator?

How can I iterate over a Set/HashSet without the following?

Iterator iter = set.iterator();
while (iter.hasNext()) {
    System.out.println(iter.next());
}

8 Answers
8

Leave a Comment