Java Operator Precedence

The following table lists operators in Java programming language. The operators are listed in the order of precedence in the following table, i.e. operators that'll be evaluated first appear higher in the table. Operators that appear on the same line have equal precedence. Two things to note though

  • All operators listed below except for the assignment operators are evaluated from left to right.
  • Assignment operators are always evaluated from right to left.
Operators Precedence
postfix i++ i--
unary ++i --i +i -i ~ !
multiplicative * / %
additive + -
shift << >> >>>
relational < > <= >= instanceof
equality == !=
bitwise AND &
bitwise exclusive OR ^
bitwise inclusive OR |
logical AND &&
logical OR ||
ternary x ? y : z
assignment = += -= *= /= %= &= ^= |= <<= >>= >>>=