Created
October 22, 2012 13:36
-
-
Save liudong/3931541 to your computer and use it in GitHub Desktop.
Java: print map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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