Abbreviated Java Operator Precedence Table
-
Grouping with parentheses:
(<expression>)
-
Unary operators:
+x, -x
(<type>) x
x++, ++x
x--, --x
!x
-
Multiplication and division operators:
x * y
x / y
x % y
-
Addition and subtraction operators:
x + y
x - y
-
Less-than and greater-than relational operators:
x < y, x > y
x <= y, x >= y
-
Equality operators:
x == y
x != y
-
"and" logical operator:
x && y
-
"or" logical operator:
x || y
-
Conditional operator: (R to L associativity)
x ? y : z
-
Assignment operators: (R to L associativity)
=
+=, -+
*=, /=, %=
The operator groups at the top of the list have higher precedence than the operator groups at the
bottom of the list. All operators within a particular group have equal
precedence. Most of the operators have left-to-right associativity. That means
that if an expression has two or more same-precedence operators, then the ones
at the left should be performed before the ones at the right. The operators
that say "R to L associativity" have right-to-left associativity.
That means that if an expression has two or more same-precedence operators,
then the ones at the right should be performed before the ones at the left.
^ Back to the Top
---------------------------------
University Resources
This page was last modified on Thursday, December 03, 2009