0% found this document useful (0 votes)
62 views2 pages

jhtp4 appCPDF

The document provides an operator precedence chart listing Java operators in decreasing order of precedence. It shows that operators like (), [], ., ++, and -- have the highest precedence, followed by unary operators like + and -, then binary operators like * and / for multiplication and division, followed by comparison operators, logical operators, ternary conditional operator, and assignment operators having the lowest precedence. The chart is split into two parts and lists each operator's type and associativity.

Uploaded by

api-3836022
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views2 pages

jhtp4 appCPDF

The document provides an operator precedence chart listing Java operators in decreasing order of precedence. It shows that operators like (), [], ., ++, and -- have the highest precedence, followed by unary operators like + and -, then binary operators like * and / for multiplication and division, followed by comparison operators, logical operators, ternary conditional operator, and assignment operators having the lowest precedence. The chart is split into two parts and lists each operator's type and associativity.

Uploaded by

api-3836022
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

jhtp4_appC.

fm Page 1353 Thursday, July 12, 2001 12:51 PM

C
Operator Precedence
Chart

Operators are shown in decreasing order of precedence from top to bottom.

Operator Type Associativity

() parentheses left to right


[] array subscript
. member selection
++ unary postincrement right to left
-- unary postdecrement
++ unary preincrement right to left
-- unary predecrement
+ unary plus
- unary minus
! unary logical negation
~ unary bitwise complement
( type ) unary cast
* multiplication left to right
/ division
% modulus
+ addition left to right
- subtraction
<< bitwise left shift left to right
>> bitwise right shift with sign extension
>>> bitwise right shift with zero extension

Fig. C.1 Operator precedence chart (part 1 of 2).


jhtp4_appC.fm Page 1354 Thursday, July 12, 2001 12:51 PM

1354 Operator Precedence Chart Appendix C

Operator Type Associativity

< relational less than left to right


<= relational less than or equal to
> relational greater than
>= relational greater than or equal to
instanceof type comparison
== relational is equal to left to right
!= relational is not equal to
& bitwise AND left to right
^ bitwise exclusive OR left to right
boolean logical exclusive OR
| bitwise inclusive OR left to right
boolean logical inclusive OR
&& logical AND left to right
|| logical OR left to right
?: ternary conditional right to left
= assignment right to left
+= addition assignment
-= subtraction assignment
*= multiplication assignment
/= division assignment
%= modulus assignment
&= bitwise AND assignment
^= bitwise exclusive OR assignment
|= bitwise inclusive OR assignment
<<= bitwise left shift assignment
>>= bitwise right shift with sign extension assignment
>>>= bitwise right shift with zero extension assignment

Fig. C.1 Operator precedence chart (part 2 of 2).

You might also like