veesong
11/17/2014 - 10:52 AM

The recommend way of iterating a map

The recommend way of iterating a map

public class IterateMap {
    public void iterator(Map<String, String> m) {
        for (Map.Entry<String, String> entry : m.entrySet()) {  
            System.out.println("key:" + entyr.getKey() + ", value=" + entry.getValue());
        }
    }
}