Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java sort a Map by keys reverse descending order

Map<String, Integer> unSortedMap = getUnSortedMapFromSource();

Map<String, Integer> reverseSortedMap 
  = new TreeMap<String, Integer>(Collections.reverseOrder());

reverseSortedMap.putAll(unSortedMap);
Source by howtodoinjava.com #
 
PREVIOUS NEXT
Tagged: #java #sort #Map #keys #reverse #descending #order
ADD COMMENT
Topic
Name
5+5 =