posted 20 years ago
Hi,
we are reading the excellent book Java2 Study guide for 310-035 but we have a little question about a boolean expression that is in there.
it says that with the following statement:
when y = 5, x = 2 and doStuff() always returns true, it will print nothing.
However in our mind it should evaluate to [BOLD]true[/BOLD]!
It says the runtime compiler would execute it like
Why??? Are there rules for the precedence of operators? Do the shortcircuit operator have a lower precedence than the boolean operators?
Have help would be appreciated.
Regards,
Robert Willems
Regards,<br />Robert Willems of Brilman<br /> <br />----------------------<br /> <br />SCJP 1.4<br />SCWCD 1.3<br />SCWCD 1.4 (beta)<br />SCDJWS 1.4 (beta)<br />SCBCD 1.3 (studying)