This week's book giveaway is in the Servlets forum. We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line! See this thread for details.

byte b = -42; // 1101 0110 int result = b >>> 4; // 268435453

It is instructive to compare the value of the expression (-42 >>> 4) with that of the expression (-42 >> 4), which has the value -3. The byte value for b, after unary numeric promotion to int, is shifted right with zero-fill four places.

But in the asked question since we are using an assigment operator the casting is done by the operator implicitly so 0111 1111 1111 1111 1111 1111 1111 1001 the higher order bits are dropped and what results is 1111 1001 which is -7.