Skip to content

Instantly share code, notes, and snippets.

@ejknapp
Created October 9, 2012 21:01
Show Gist options
  • Save ejknapp/3861412 to your computer and use it in GitHub Desktop.
Save ejknapp/3861412 to your computer and use it in GitHub Desktop.
Maps
Map<String, String> map = new TreeMap<String, String>();
map.put("WI", "Wisconsin");
map.put("MN", "Wisconsin");
map.put("MI", "Wisconsin");
map.put("IA", "Wisconsin");
for (Map.Entry<String, String> entry : map.entrySet()) {
System.out.println("Key: " + entry.getKey()
+ ", value: " + entry.getValue());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment