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 ]
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
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop