Hi Luk,
An overflow occurs when the value assigned to a variable is larger than the maximum value the type can contain.
Java does not produce a runtime exception when this happens; rather, it drops the high-order bits.
In your example, a byte can hold the positive values 0 to 127; once you reach '128' you overflow <code>byte</code> type. '128' is represented by '1000 0000' where the '1' is in the sign position, setting the value to a negative or less than zero, so you're loop ends without an error.
Actually, in your example, 'Welcome to Java' is displayed once. If you modify the code you can get a better picture of what's happening.
The last line printed shows that b is equal to '-128' ... the negative sign is the result of the way Java handles the overflow; it fills all the high order bits for the int type with the sign value.
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform