Its simple. Size of byte is 8 bits, So the range of values it can take is -2x7 to + 2x7-1 which is (-128 to 127) . If you assign any value out of this range it will cycle through the above range [bit calculation]. Since you have assigned 128 which is excatly next number to 127 and so the value thats stored in byte variable is -128. Hope this answers your question. Thanks Deepak
A byte has it's 8th bit as the sign bit. Hence 1000 0000 , a byte will interpret as negative number and the no. will be calculated using 2's complement.
Which means 1000 0000 --> 0111 1111 + 1 ---------- 1000 0000
So, would you please change your user name before your next posting? It will not affect anything you've already posted here. Just your user name will update.
Regards, Bu.
all events occur in real time
You can't have everything. Where would you put it?