Campbell Ritchie wrote:You can’t assign 256 to a byte, signed or unsigned. That is outwith the range of bytes, signed or unsigned. The highest value of an unsigned byte (which you don’t get in Java) is 255.
I believe what Meeta was trying to say was that we can store 256 different values (-127 through 0 to 128) and not value 256 itself.
Joined: Oct 13, 2005
Yes, that is correct. You get 2⁸ different values = 256.