Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java 8 list to map with occurrences

    Map<String, Long> cardsMap = cards
            .stream()
            .collect(Collectors.groupingBy(Card::getCardValue, Collectors.counting()));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #list #map #occurrences
ADD COMMENT
Topic
Name
9+8 =