fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.util.HashMap;
  5.  
  6. class Ideone
  7. {public static void main(String[] args)
  8. {HashMap<String, Integer> people = new HashMap<String, Integer>();
  9. people.put("John", 32);
  10. people.put("Steve", 30);
  11. people.put("Angie", 33);
  12. System.out.println("key: John" + " value: " + people.get("John"));
  13. for (String i : people.keySet()) {System.out.println(people.get(i));}
  14. }
  15. }
Success #stdin #stdout 0.09s 35616KB
stdin
Standard input is empty
stdout
key: John value: 32
33
30
32