Skip to content

Instantly share code, notes, and snippets.

@liudong
Created October 22, 2012 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liudong/3931541 to your computer and use it in GitHub Desktop.
Save liudong/3931541 to your computer and use it in GitHub Desktop.
Java: print map
private void printMap(Map<String, String> map) {
Set<String> keys = map.keySet();
Iterator<String> iter = keys.iterator();
while ( iter.hasNext() ) {
String key = iter.next();
System.out.println("Key: " + key);
String obj = map.get(key);
System.out.println(obj);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment