Java Reference
In-Depth Information
Of course, if the high order bit in the
>>
operation in
Figure 2-4
were zero, there would be three zeros at
the leftmost end of the result.
Shift operations are often used in combination with the other bitwise operators I have discussed to extract
parts of an integer value. In many operating systems a single 32-bit value is sometimes used to store multiple
values. For example, you could store two 16-bit screen coordinates in a single 32-bit word. This is illustrated
in
Figure 2-5
.