The order of operations.
&&has a higher priority than ||, and therefore is evaluated first. Your condition ifcan be rewritten as follows:
(a && a) || b
(false && false) || true
false || true
true
This condition will always be false || true, which is always truefor the conditions you have listed.
Check here for the official table from Oracle, which lists the priorities of all operators.
source
share