1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | public class MapMain { public static void main(String[] args) { Map<Integer,String> map = new AlphaMapLL(); // change this to AlphaMap() map.set(222222, "Ernest Hemingway"); map.set(111111, "Ray Charles"); map.set(333333, "John F Kennedy"); System.out.println(map.get(333333)); // should print John F Kennedy System.out.println(map.get(222222)); // should print Ernest Hemingway String name = map.get(444444); if (name == null) System.out.println("444444 is not in the map"); // should do this else System.out.println("this is not right: " + name); // not this // uncomment this line once you get size() working! // System.out.println(map.size()); } } |