String Concatenation With Primitive Types
All of the following statements about concatenating String objects with primitive types in Java are true EXCEPT:
int number = 10;
System.out.println("The number is " + number);
A
The + operator, when used with a string, performs implicit conversion of non-string operands to strings.
B
Attempting to concatenate a string with a number using the + operator will result in a compile-time error.
C
Proper use of concatenation can be useful for constructing dynamic messages in output.
D
Concatenation allows combining strings with other primitive types to form a complete expression.
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | lsj08030922 | 4 | 4 | 0m 43s | 357 |
| #2 | varunrajaram1 | 4 | 7 | 0m 31s | 339 |
| #3 | sailajavadlamani33 | 3 | 4 | 0m 00s | 290 |
| #4 | waynechen0110 | 2 | 2 | 0m 00s | 200 |
| #5 | avantikaabaid10901 | 2 | 2 | 0m 00s | 200 |
| #6 | klal2026 | 3 | 4 | 1m 49s | 181 |
| #7 | lamunghkunsengaung2007 | 2 | 2 | 0m 20s | 180 |
| #8 | pgnaiad | 2 | 2 | 0m 23s | 177 |
| #9 | benjamin | 2 | 2 | 0m 26s | 174 |
| #10 | vugiakhanh3011 | 2 | 5 | 0m 00s | 170 |
Items per page:
10
1 – 10 of 72
