-128 in decimal is 11111111 11111111 11111111 10000000 in binary
a >> 1 shifts the bits of a one place to the right, filling the gap on the left with a copy of the original leftmost (sign) bit, giving us -64 in decimal which is 11111111 11111111 11111111 11000000 in binary
SCJP 1.4, SCWCD in process
Joined: Mar 13, 2004
To convert a two's complement negative binary number to decimal, replace every 1 with a 0 and every 0 with a 1, then add 1 to the result. Convert that number to decimal and show it with a minus sign.