posted 24 years ago
As you know during shift operation of short variable, first it is converted to int. The result is also int. The ideal statement should look like : s = (short) (s >> 10); However I see something strange below.
short s=-1;
s >>>= 10 ; // this does not need explicit cast.
//s = s>>> 10 ; // but this does need cast.
Why? Any body.