Java Reference
In-Depth Information
Appendix 2
Operators
Table A.2.1
Assignment operators. x and y must be numeric or char types
except for
“=
”
,which allows x and y also to be object references. In this case, x
must be of the same type of class or interface as y. If mixed floating-point and
integer types, the rules for mixed types in expressions apply.
Operator
Description
Assignment operator:
x = y;
yisevaluated and x set to this value.
The value of x is then returned.
=
+=
,
-=
,
*=
,
/=
,
%=
Arithmetic operation and then assignment, e.g.
x+= y;
is equivalent to
x = x+y;
&=
, |
=
,
^=
Bitwise operation and then assignment, e.g.
x&= y;
is equivalent to
x = x&y;
<<=
,
>>=
,
>>>=
Shift operations and then assignment, e.g.
x
<<=
n;
is equivalent to
x
=
x
<<
n;
685
Search WWH ::
Custom Search