fork download
  1. class Test
  2. {
  3. private static boolean b(String label, boolean value) {
  4. System.out.println(label + ": " + value);
  5. return value;
  6. }
  7. public static void main(String[] args)
  8. {
  9. if (b("1", true) || (b("2", false) || b("3", true)) && b("4", false))
  10. {
  11. System.out.println("How does this condition becomes true.");
  12. }
  13.  
  14. if (b("5", false) && (b("6", false) || b("7", true)) || b("8", true))
  15. {
  16. System.out.println("Same with this condition, why is it true.");
  17. }
  18. }
  19. }
  20.  
Success #stdin #stdout 0.1s 27824KB
stdin
Standard input is empty
stdout
1: true
How does this condition becomes true.
5: false
8: true
Same with this condition, why is it true.