package integer.overflow; /** * * @author justi */ public class IntegerOverflow { /** * @param args the command line arguments */ public static void main(String[] args) { //int a is equal to the largest int available int a = Integer.MAX_VALUE; int b = 1; //calculation will result in integer overflow int c = a + b; System.out.println(a + " + " + b + " = " + c); } }