fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. Map<Object, Object> m = new LinkedHashMap<>();
  13. m.put("zero", 0);
  14. m.put("1", 1.5);
  15. m.put(2.5, new Date());
  16.  
  17. for(Map.Entry<Object, Object> e : m.entrySet()){
  18. System.out.println(e.getKey().getClass().getName() + "(" + e.getKey() + ")");
  19. System.out.println(e.getValue().getClass().getName() + "(" + e.getValue() + ")");
  20. }
  21. }
  22. }
Success #stdin #stdout 0.1s 380928KB
stdin
Standard input is empty
stdout
java.lang.String(zero)
java.lang.Integer(0)
java.lang.String(1)
java.lang.Double(1.5)
java.lang.Double(2.5)
java.util.Date(Thu Oct 19 07:19:28 GMT 2000)