Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

iterating over a hashmap

for(Map.Entry<String, Integer> entry : hashMap.entrySet()) {
    String key = entry.getKey();
    Integer value =  entry.getValue();
    //do something with the key and value
}
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #iterating #hashmap
ADD COMMENT
Topic
Name
6+6 =