Ify
numbers 1, 2, and 3 are all true. 4 is false because there is no operator '<<<'.
for 1 and 2 that is the unsigned right shift, the bits are shifted to the right and filled in with 0s. So, in both of them you start with -1, which is
11111111 11111111 11111111 11111111
when you shift it right 2 places you get:
00111111 11111111 11111111 11111111
Because the sign bit (the furthest to the left) is 0 the number is positive (if it were a 1 then the number would be negative).
The value of 10 in binary is
00000000 00000000 00000000 00001010
so the number you got after shifting is much larger than 10.
Here are some other links to shift related topics:
http://www.javaranch.com/ubb/Forum33/HTML/002817.html http://www.javaranch.com/ubb/Forum24/HTML/011093.html And then there is the campfire story too:
http://www.javaranch.com/campfire/StoryBits.jsp hope this helps
------------------
Dave
Sun Certified Programmer for the Java� 2 Platform
[This message has been edited by Dave Vick (edited September 21, 2001).]