fork(4) download
  1. public class Main {
  2. public static void main(String[] args) throws Exception {
  3. Dummy x = null;
  4. boolean a = true;
  5. a |= x.getValue();
  6. System.out.println(a);
  7. }
  8.  
  9. private static class Dummy {
  10. private final boolean value;
  11. public boolean getValue() { return value; }
  12. Dummy(boolean value) { this.value = value; }
  13. }
  14. }
Runtime error #stdin #stdout #stderr 0.1s 320320KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.lang.NullPointerException
	at Main.main(Main.java:5)