+ 1
you can! If you want both the key and value at the same time in a loop then the following achieves it:
HashMap<String, String> map = getHashMap();
for(Entry<String, String> entry : map.getEntrySet()) {
String key = entry.getKey();
String value = entry.getValue();
// Do something
}



