char c = 'A';
int n = c + 1;
System.out.println(n);What is printed?
- A
65
- B
A1
- Ccheck_circle
66
- D
B
Explanation
'A' has Unicode value 65; adding 1 promotes it to int 66, which is printed as the integer 66.
AP Computer Science A· difficulty 4/5
char c = 'A';
int n = c + 1;
System.out.println(n);What is printed?
65
A1
66
B
Explanation
'A' has Unicode value 65; adding 1 promotes it to int 66, which is printed as the integer 66.
Want 10 more like this — adaptive to your weak spots?