fork download
  1. import java.util.*;
  2.  
  3. class Example {
  4. static void accept(Double d) {}
  5.  
  6. public static void main(String[] args) {
  7. System.out.println(System.getProperty("java.version"));
  8. Double d = false ? 1.0 : new HashMap<String, Double>().get("1");
  9. System.out.println(d);
  10. // this should be the same, right?
  11. accept(false ? 1.0 : new HashMap<String, Double>().get("1"));
  12. }
  13. }
Runtime error #stdin #stdout #stderr 0.06s 27824KB
stdin
Standard input is empty
stdout
1.8.0_112
null
stderr
Exception in thread "main" java.lang.NullPointerException
	at Example.main(Main.java:11)