FileDocCategorySizeDatePackage
ByteAdd2.javaAPI DocExample401Sat Nov 25 12:55:38 GMT 2000None

ByteAdd2

public class ByteAdd2 extends Object
This shows something interesting about addition of "byte" variables (which also applies to all integer types).

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)

		System.out.println("ByteAdd Program");
		// bytes are signed integer, so can range from -127 to +127
		byte b1 = 10;
		b1 += 1;		// This works, following does not:
		b1 = b1 + 1;	// EXPECT COMPILE ERROR