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

  10. 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.

These characters and their underlying numberic values are the same as the first 128 characters in the Unicode table.

Numeric Value Character Numeric Value Character Numeric Value Character Numeric Value Character
0 null 32 space 64 @ 96 '
1 start of heading 33 ! 65 A 97 a
2 start of text 34 " 66 B 98 b
3 end of text 35 # 67 C 99 c
4 end of transmission 36 $ 68 D 100 d
5 enquiry 37 % 69 E 101 e
6 acknowledge 38 & 70 F 102 f
7 audible bell 39 ' 71 G 103 g
8 backspace 40 ( 72 H 104 h
9 horizontal tab 41 ) 73 I 105 i
10 line feed 42 * 74 J 106 j
11 vertical tab 43 + 75 K 107 k
12 form feed 44 , 76 L 108 l
13 carriage return 45 - 77 M 109 m
14 shift out 46 . 78 N 110 n
15 shift in 47 / 79 O 111 o
16 data link escape 48 0 80 P 112 p
17 device control 1 49 1 81 Q 113 q
18 device control 2 50 2 82 R 114 r
19 device control 3 51 3 83 S 115 s
20 device control 4 52 4 84 T 116 t
21 negative acknowledge 53 5 85 U 117 u
22 synchronous idle 54 6 86 V 118 v
23 end transmission block 55 7 87 W 119 w
24 cancel 56 8 88 X 120 x
25 end of medium 57 9 89 Y 121 y
26 substitute 58 : 90 Z 122 z
27 escape 59 ; 91 [ 123 {
28 file separator 60 < 92 \ 124 |
29 group separator 61 = 93 ] 125 }
29 record separator 62 > 94 ^ 126 `
31 unit separator 63 ? 95 _ 127 delete