Note: (Restricted functionality due to obvious reasons!)

For Mobile-Ease ⇓

Minimal Code ( Raw-View ) :
import java.util.*; class SortedSetDemo { public static void main(String zee[]) { SortedSet s = new TreeSet(); //Interface[Set] variable[s] = new ImplementationClass[HashSet]{of Interface-Set] s.add("Deepak"); // m.put(key, value) s.add("Abhi"); s.add("John"); Iterator itr = s.iterator(); while(itr.hasNext()) { String str = (String)itr.next(); System.out.println(str); } } }