import java.util.HashSet; import java.util.Iterator; import java.util.Set; public class MainClass { public static void main(String[] argv) { Set set = new HashSet(); set.add("1"); set.add("2"); set.add("3"); Iterator it = set.iterator(); while (it.hasNext()) { System.out.println(it.next()); } } }
3 2 1