Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

iterate map in java 8 using stream

public void iterateUsingStreamAPI(Map<String, Integer> map) {
    map.entrySet().stream()
      // ...
      .forEach(e -> System.out.println(e.getKey() + ":" + e.getValue()));
}
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #iterate #map #java #stream
ADD COMMENT
Topic
Name
5+4 =