Java Reference
In-Depth Information
Table 4-6.
Java Operators and Their Precedence
Level
Operator Symbol
Action Performed
++
1
Pre-or-post increment
--
Pre-or-post decrement
+, -
Unary plus, unary minus
~
Bitwise complement
!
Logical Not
(type)
Cast
*, /, %
2
Multiplication, division, modulus
+, -
3
Addition, subtraction
+
String concatenation
<<
4
Left shift
>>
Signed right shift
>>>
Unsigned right shift
<
5
Less than
<=
Less than or equal
>
Greater than
>=
Greater than or equal
instanceof
Type comparison
==
6
Equal in value
!=
Not equal to
&
7
Bitwise AND
&
Logical AND
^
8
Bitwise XOR
^
Logical XOR
|
9
Bitwise OR
|
Logical OR
&&
10
Logical short-circuit AND
||
11
Logical short-circuit OR
?:
12
Ternary
=
13
Assignment
+=
,
-=
,
*=
,
/=
,
%=
,
<<=
,
>>=
,
>>>=
,
&=
,
|=
,
^=
Compound assignment