Information and Computer Science


Abbreviated Java Operator Precedence Table

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. Download Table Go

  1. Grouping with parentheses:
    (<expression>)

  2. Unary operators:
    +x, -x
    (<type>) x
    x++, ++x
    x--, --x
    !x

  3. Multiplication and division operators:
    x * y
    x / y
    x % y

  4. Addition and subtraction operators:
    x + y
    x - y

  5. Less-than and greater-than relational operators:
    x < y, x > y
    x <= y, x >= y

  6. Equality operators:
    x == y
    x != y

  7. "and" logical operator:
    x && y

  8. "or" logical operator:
    x || y

  9. Conditional operator: (R to L associativity)
    x ? y : z

  10. Assignment operators: (R to L associativity)
    =
    +=, -+
    *=, /=, %=