fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.util.Collection.*;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. // your code goes here
  14. Map map = new HashMap();
  15. map.put("英文", new int[] { 123, 100, 99 });
  16. map.put("数学", new int[] { 100, 90, 89 });
  17. map.put("语文", new int[] { 90, 78, 97 });
  18. map.put("政治", new int[] { 100, 29, 20 });
  19. for (Object obj : map.keySet())
  20. {
  21. System.out.println("--------------");
  22. System.out.println(obj);
  23. for (Object x : (int[])map.get(obj))
  24. System.out.println(x);
  25. }
  26. }
  27. }
Success #stdin #stdout 0.1s 320576KB
stdin
Standard input is empty
stdout
--------------
政治
100
29
20
--------------
英文
123
100
99
--------------
数学
100
90
89
--------------
语文
90
78
97