This week's book giveaway is in the Android forum. We're giving away four copies of Create an Uber Clone in 7 Days: Build a real world full stack mobile app in Java and have Shai Almog on-line! See this thread for details.
Expression b += 1; is evaluated as b = (byte)(b +1); Hence it does not complain, as the cast is put for you by the compiler. In your second code snippet. byte c = (a+b); Both a and b are promoted to int (numeric binary promotion) so the expression becomes c = (int)a + (int)b; If you do not cast it to byte, it becomes an error since you are trying to store int value in byte variable (i.e c) -Sandeep Nachane www.tipsmart.com
[This message has been edited by Sandeep Nachane (edited July 13, 2001).]