Hi, I've a doubt concerning the decrement operator. Could someone please explain the following to me: byte y = -128; byte x = y--; System.out.println ("y = " + y); Output: y = 127

I cant figure out how the value of y became 127. Thanks. Rebecca

y-- is equivalent to y = y - 1 that is y = -128 - 1 = -129 -128 = 1000 0000 -1 = 1111 1111 1000 0000 +1111 1111 ----------- 1 0111 1111 The leftmost bit is ignored, thus resulting 127

- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. <br />- What truth? <br />- That there is no spoon!!!