Rows closest to top of table have higher precedence.
Operators in the same box have same precedence.
| Operator | Type | Associativity |
|---|---|---|
| ( ) . |
Parentheses Member selection e.g., canvas.getWidth()/2 |
Left to Right |
| ++ -- |
unary increment unary decrement e.g., pressCnt++; |
|
| - ! |
Unary minus
Unary logical negation e.g., -50.25 ! rich |
|
| * / % |
Multiplication Division Ch 1.2 Modulus(p.22) |
Left to right |
| + - |
Addition Subtraction |
Left to right |
| < <= > >= |
Relational less than Relational less than or equal Relational greater than Relational greater than or equal |
Left to right |
| == != |
Relational is equal to Relational is not equal to |
Left to right |
| ! | Unary logical negation (ie, !raining) |
|
| && | Logical AND | Left to right |
| || | Logical OR | Left to right |
| = | Assignment |