// Hunter Schafer, CSE 143 // Sample program that demonstrates map // import java.util.*; public class MapExample { public static void main(String[] args) { Map map = new TreeMap(); map.put("Hunter", 3); // Like map["Hunter"] = 3; map.put("Taylor", 2); System.out.println(map.get("Hunter")); // Like map["Hunter"] // Can't do map.get("Hunter")++; map.put("Hunter", map.get("Hunter") + 1); System.out.println(map.get("Hunter")); // should be 1 more than before System.out.println(map); } }