Adding 1 to <code>Integer.MAX_VALUE</code> produces
- A
Stays at MAX_VALUE
- Bcheck_circle
Wraps to Integer.MIN_VALUE (overflow)
- C
Becomes 0
- D
Throws OverflowException
Explanation
Java integer overflow wraps silently; no exception thrown.
AP Computer Science A· difficulty 4/5
Adding 1 to <code>Integer.MAX_VALUE</code> produces
Stays at MAX_VALUE
Wraps to Integer.MIN_VALUE (overflow)
Becomes 0
Throws OverflowException
Explanation
Java integer overflow wraps silently; no exception thrown.
Want 10 more like this — adaptive to your weak spots?