Java Integer Overflow
What is printed when the following code segment is executed?
int max = Integer.MAX_VALUE;
int result = max + 1;
System.out.println(result);
A
2147483647
B
-2147483648
C
2147483648
D
An ArithmeticException is thrown
What is printed when the following code segment is executed?
int max = Integer.MAX_VALUE;
int result = max + 1;
System.out.println(result);
2147483647
-2147483648
2147483648
An ArithmeticException is thrown