1for (Map.Entry<String, String> entry : yourHashMap.entrySet()) {
2 System.out.println(entry.getKey() + " = " + entry.getValue());
3}
1for(Map.Entry<String, Integer> entry : hashMap.entrySet()) {
2 String key = entry.getKey();
3 Integer value = entry.getValue();
4 //do something with the key and value
5}