Programming and Problem Solving with Java

(やまだぃちぅ) #1

684


Precedence (highest to lowest)

Operator Assoc.* Operand Type(s) Operation Performed
| LR integer, integer bitwise OR
| LR boolean, boolean boolean OR
&& LR boolean, boolean conditional AND
(short-circuit evaluation)
|| LR boolean, boolean conditional OR
(short-circuit evaluation)
?: RL boolean, any, any conditional (ternary) operator
= RL variable, any assignment
*=, /=, %=, +=, -=, <<=,
>>=, >>>=, &=, ^=, |= RL variable, any assignment with operation

*LR means left-to-right associativity; RL means right-to-left associativity.
Free download pdf