Commit 5b0fe263 authored by Trisha Gee's avatar Trisha Gee
Browse files

[Ch10b] Map example

parent f42fde3e
Loading
Loading
Loading
Loading
+16 −0
Changes for src/main/java/ch10b/TestMap.java: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line
package ch10b;

import java.util.*;

public class TestMap {
  public static void main(String[] args) {
    HashMap<String, Integer> scores = new HashMap<>();

    scores.put("Kathy", 42);
    scores.put("Bert", 343);
    scores.put("Skyler", 420);

    System.out.println(scores);
    System.out.println(scores.get("Bert"));
  }
}
 No newline at end of file