1public static void printMap(Map mp) {
2 Iterator it = mp.entrySet().iterator();
3 while (it.hasNext()) {
4 Map.Entry pair = (Map.Entry)it.next();
5 System.out.println(pair.getKey() + " = " + pair.getValue());
6 it.remove(); // avoids a ConcurrentModificationException
7 }
8}
1for (V valuesName : arbitraryHashMap.values()) {
2 //Do Stuff with valuesName
3}