int x = Integer.MAX_VALUE; long y = Long.MAX_VALUE; System.out.println(x); System.out.println(y); System.out.println(x*2); // result -2 System.out.println(y*2); // result -2 Why I'm getting -2 as result when multiplying maximum value by 2, also I'm not evening storing the value just printing.