0% found this document useful (0 votes)
70 views

Operator Precedence

Operator precedence and associativity determine the order in which operators are evaluated in an expression. The table lists various operators, their descriptions, associativity (whether they group left-to-right or right-to-left) and rank (precedence level from 1 to 14). For example, multiplication has higher precedence than addition, so it will be evaluated first.

Uploaded by

AnuragGupta
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

Operator Precedence

Operator precedence and associativity determine the order in which operators are evaluated in an expression. The table lists various operators, their descriptions, associativity (whether they group left-to-right or right-to-left) and rank (precedence level from 1 to 14). For example, multiplication has higher precedence than addition, so it will be evaluated first.

Uploaded by

AnuragGupta
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

OPERATOR PRECEDENCE & ASSOCIATIVITY

Operator
.
()
[]
++
-!
~
(type)
*
/
%
+
<<
>>
>>>
<
<=
>
>=
instanceof
==
!=
&
^
|
&&
||
?:
=
op=

Description
Member selection
Function call
Array element reference
Unary minus
Increment
Decrement
Logical negation
Ones complement
Casting
Multiplication
Division
Modulus
Addition
Subtraction
Left shift
Right shift
Right shift with zero fill
Less than
Less than or equal to
Greater than
Greater than or equal to
Type comparison
Equality
Inequality
Bitwise AND
Bitwise XOR
Bitwise OR
Logical AND
Logical OR
Conditional operator
Assignment operator
Shorthand assignment

Associativity

Rank

Left to right

Right to left

Left to right

Left to right

Left to right

Left to right

Left to right

Left to right
Left to right
Left to right
Left to right
Left to right
Right to left
Right to left

8
9
10
11
12
13
14

You might also like