Set<String> set = new HashSet<String>; Iterator<String> iterator = set.iterator(); while(iterator.hasNext()){ String aString = iterator.next(); }