Created
March 14, 2014 01:44
-
-
Save ejknapp/9540727 to your computer and use it in GitHub Desktop.
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
package java112.labs2; | |
import java.io.*; | |
import java.util.*; | |
/** | |
* @author Eric Knapp | |
* class MapDemo | |
*/ | |
public class MapDemo { | |
public void run() { | |
Map<String, Integer> map = new TreeMap<String, Integer>(); | |
map.put("one", 1); | |
map.put("two", 2); | |
map.put("three", 3); | |
map.put("four", 4); | |
map.put("five", 5); | |
for (Map.Entry entry : map.entrySet()) { | |
System.out.println(entry.getKey() + "\t" + entry.getValue()); | |
} | |
} | |
public static void main(String[] args) { | |
MapDemo demo = new MapDemo(); | |
demo.run(); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment