I'm pretty sure there's no implicit casting going on here. If you continue the loop, you'll see that value of b never exceeds the value of a signed byte, merely that the sign changes. So unless I misunderstand what's going on (some one please correct me if I am), I believe that no, there is no casting going on and that doing an increment (or decrement) operation on a byte does not implicitly change the byte to an int.
Also, I read the spec Daniel Moore posted, and I was unable to find where it mentions implicit casting in the increment operator. Could someone please point me in the right direction? [ August 24, 2004: Message edited by: Jason Fox ]
I believe incrementing byte (byte b with increment operator (b++ does not convert it to int but by explicitly adding 1 to byte will convert it to int (b = b+1 .
thanx guys!! Jason Fox ,shilpa challa ,Daniel Moore I tried something like the code which Daniel wrote .Silly of me not to try it out earlier.at 127 of the increment operation it gets rounded to-128 and again at -1 to 0.So i guess it still remains a Byte. So thanx u all Nikhilesh