Saturday, May 1, 2010

Types of operators in Java?

There are several types of operators, but before we go into them, you should understand a little thing we in the biz call operator precedence. Precedence determines in which order operators execute.

Operator Type
Operator Precedence
postfix
expr++ expr--
unary
++expr –expr +expr -expr ~ !
multiplicative
* / %
additive
+ -
shift
<< >> >>>
relational
< > <= >= instanceof
equality
“==” !=
bitwise AND
&
bitwise exclusive OR
^
bitwise inclusive OR
|
logical AND
&&
logical OR
||
ternary
? :
assignment
“=” += -= *= /= %= &= ^= |= <<= >>= >>>=

No comments:

Post a Comment