int x = 100000;
int y = 100000;
System.out.println(x * y);What is printed?
- A
10000000000
- Bcheck_circle
1410065408
- C
Error
- D
0
Explanation
100000 * 100000 = 10,000,000,000 which exceeds Integer.MAX_VALUE; the result wraps around to 1410065408.
AP Computer Science A· difficulty 4/5
int x = 100000;
int y = 100000;
System.out.println(x * y);What is printed?
10000000000
1410065408
Error
0
Explanation
100000 * 100000 = 10,000,000,000 which exceeds Integer.MAX_VALUE; the result wraps around to 1410065408.
Want 10 more like this — adaptive to your weak spots?