public class PosNeg
{
	public static void main(String[] args) {
		int x = Integer.MAX_VALUE;
		System.out.println("Integer.MAX_VALUE = " + x);
		System.out.println("Integer.MAX_VALUE+1 = " + (x+1));
		int y = Integer.MIN_VALUE;
		System.out.println("Integer.MIN_VALUE = " + y);
		System.out.println("Integer.MIN_VALUE-1 = " + (y-1));
		byte z = Byte.MAX_VALUE;
		System.out.println("Byte.MAX_VALUE = " + z);
		System.out.println("Byte.MAX_VALUE+1 = " + (z+1));
		System.out.println("Byte.MAX_VALUE+(byte)1 = " + (byte)(z+1));
		byte w = Byte.MIN_VALUE;
		System.out.println("Byte.MIN_VALUE = " + w);
		System.out.println("Byte.MIN_VALUE-1 = " + (w-1));
		System.out.println("Byte.MIN_VALUE-(byte)1 = " + (byte)(w-1));
		int a = 138;
		byte b = (byte) a; // What is now the value of b?
		System.out.println("a = " + a + "  b = " + b);
		System.out.println(" a == b is " + (a==b));
	}
}
/* The output is
Integer.MAX_VALUE = 2147483647
Integer.MAX_VALUE+1 = -2147483648
Integer.MIN_VALUE = -2147483648
Integer.MIN_VALUE-1 = 2147483647
Byte.MAX_VALUE = 127
Byte.MAX_VALUE+1 = 128
Byte.MAX_VALUE+(byte)1 = -128
Byte.MIN_VALUE = -128
Byte.MIN_VALUE-1 = -129
Byte.MIN_VALUE-(byte)1 = 127
a = 138  b = -118
 a == b is false
*/
