CheatSheet for Interview
How to Iterate HashMap?
for(Map.Entry<Integer, Integer> entry : map.entrySet()) {
int value=entry.getValue();
int key = entry.getKey();
}
for(Map.Entry<Integer, Integer> entry : map.entrySet()) {
int value=entry.getValue();
int key = entry.getKey();
}