Park University Logo

Park.edu Home > Information and Computer Science > ICS Home

Abbreviated Java Operator Precedence Table

  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:
    x ? y : z                R to L associativity

  10. Assignment operators:
    =                          R to L associativity
    +=, -+                  R to L associativity
    *=, /=, %=           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 January 10 2008