posted 24 years ago
Hi Bharatesh,
Shift operators are subject to unary numeric promotion not binary; so <code>long</code> values do not force conversion of <code>int</code> values.
See JLS §5.6.1
<quote>
Each operand, separately, of a shift operator >>, >>>, or << (�15.19); therefore a long
shift distance (right operand) does not promote the value being shifted (left operand)
to long
</quote>
Hope that helps.
------------------
Jane
The cure for boredom is curiosity.
There is no cure for curiosity.
-- Dorothy Parker