b = true
FAILED: b = true && b
b = true || b
(b = true) && b
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Innar Made wrote:
Since && and || have higher precedence, they will be evaluated first.
Innar Made wrote:Just my reflection of how I understand this now:
Here short-circuit && sees that b is false and fails the if expression. The boolean b inside the IF doesn't get assigned to true, since IF condition was failed by && already.
Innar Made wrote:
Here the short-circuit || sees that b is true and the IF condition succeeds right after that, b doesn't get assigned to true.