char c = 'X';
String s = "" + c + c;
System.out.println(s);What is printed?
- Acheck_circle
XX
- B
X
- C
88
- D
176
Explanation
The empty string forces concatenation rather than int addition; 'X' is appended twice as a character.
AP Computer Science A· difficulty 3/5
char c = 'X';
String s = "" + c + c;
System.out.println(s);What is printed?
XX
X
88
176
Explanation
The empty string forces concatenation rather than int addition; 'X' is appended twice as a character.
Want 10 more like this — adaptive to your weak spots?