package devmanuals.com; import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.ConcurrentNavigableMap; public class CNMDescendingMap { public static void main (String args[]){ ConcurrentNavigableMap cnm = new ConcurrentSkipListMap(); cnm.put(1,"A"); cnm.put(2,"B"); cnm.put(3,"C"); cnm.put(4,"D"); cnm.put(5,"E"); cnm.put(6,"F"); System.out.println("Mappings = "+cnm); System.out.println("Set of keys = "+cnm.keySet()); System.out.println("First entry of the map : "+cnm.firstEntry()); System.out.println("Last entry of the map : "+cnm.lastEntry()); cnm=cnm.descendingMap(); System.out.println("Mappings in descending order = "+cnm); System.out.println("Size of map = "+cnm.size()); for(int i=0;i<=6;i++){ cnm.remove(6); } System.out.println("Remainig set of keys = "+cnm.keySet()); System.out.println("Remaining size of map = "+cnm.size()); } }