HashSet set = new HashSet<>();
set.add(“f”);
set.add(“a”);
set.add(“b”);
set.add(“d”);
// enhance for Loop through
for (String string: set) { System.out.println(string); }
set.iterator().next() to
get the first element
Simple and rude
HashSet set = new HashSet<>();
set.add(“f”);
set.add(“a”);
set.add(“b”);
set.add(“d”);
// enhance for Loop through
for (String string: set) { System.out.println(string); }
set.iterator().next() to
get the first element
Simple and rude