Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

ordenar mapa de forma descendente java

final Map<String, Integer> sortedByCount = wordCounts.entrySet()
                .stream()
                .sorted(Map.Entry.comparingByValue())
                .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new));
Source by www.clubdetecnologia.net #
 
PREVIOUS NEXT
Tagged: #ordenar #mapa #de #forma #descendente #java
ADD COMMENT
Topic
Name
4+8 =