Sunday, August 12, 2012

JAVA OPERATORS


SUMMARY OF JAVA OPERATORS:

OPERATOR
DESCRIPTION
ASSOCIATIVITY
RANK
.
Member Selection
Left to Right
1
( )
Function Call


[ ]
Array Element Reference


-
Unary Minus
Right to Left
2
++
Increment


- -
Decrement


!
Logical Negation


~
Ones Complement


(type)
Casting


*
Multiplication
Left to Right
3
/
Division


%
Modulus


+
Addition
Left to Right
4
-
Subtraction


<< 
Left Shift
Left to Right
5
>> 
Right Shift


>>> 
Right Shift with Zero fill


< 
Less than
Left to Right
6
<=
Less than or equal to


> 
Greater than


>=
Greater than or equal to


instanceof
Type Comparison


==
Equality
Left to Right
7
!=
Inequality


&
Bitwise AND
Left to Right
8
^
Bitwise XOR
Left to Right
9
|
Bitwise OR
Left to Right
10
&&
Logical AND
Left to Right
11
||
Logical OR
Left to Right
12
? :
Conditional Operator
Right to Left
13
=
Assignment Operator
Right to Left
14
op=
Shorthand Operator



No comments:

Post a Comment