Answers for "can we use iterator in hashmap"

1

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
}
Posted by: Guest on November-19-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language