int n = 5;
Integer w = n;
System.out.println(w + 1);What is printed?
- Acheck_circle
6
- B
5
- C
51
- D
Error
Explanation
The int 5 is autoboxed into Integer w, then unboxed for arithmetic; the result is 6.
AP Computer Science A· difficulty 3/5
int n = 5;
Integer w = n;
System.out.println(w + 1);What is printed?
6
5
51
Error
Explanation
The int 5 is autoboxed into Integer w, then unboxed for arithmetic; the result is 6.
Want 10 more like this — adaptive to your weak spots?