Tuesday, February 1, 2011

Easy Way to iterate Over Map

public void displayMapContaint(Map<String, String> data) {
  for (Map.Entry<String, String> pair : data.entrySet()) {
   System.out.println("Key: " + pair.getKey() + " Data: "+ pair.getValue());
  }
 }

No comments: