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