It's not about the VM, the VM works on a lower level and doesn't even see expressions in the same order as you write them in Java. What is important here is operator precedence:
http://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html
Just like they teach you "multiplication before addition" at school, there's a precedence for all the other operators as well. In Java's case, &&
has higher precedence than ||
. Therefore
(A == true && B == true || C == true)
is equivalent to
((A == true && B == true) || C == true)
But in reality, just like you said, use those parenthesis. It makes it easier to read.
Free protip: == true
is superfluous. It doesn't do anything. Replace A == true
with just A
.