Java order of operator precedence | rule | | that operators at the top take precedence over operators lower in the table. At the same level of the table, operators are evaluated from left to right.
operators | comments |
---|
() [] | Anything in parentheses, including array indexing, is evaluated first | ++ -- ! | Unary operators | * / % | Multiplicative operators | + - | Additive binary operators | > >= < <= | Relational comparison operators | == != | Identity comparison operators | && | Logical AND | \ | Logical OR | ?: | Ternary if-then-else | = += *= -= /=/td> | Assignment |
| The Basics of Java | |