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
Proper use of concatenation can be useful for constructing dynamic messages in output.
C
Concatenation allows combining strings with other primitive types to form a complete expression.
D
Attempting to concatenate a string with a number using the + operator will result in a compile-time error.
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 | vugiakhanh3011 | 2 | 5 | 0m 00s | 170 |
| #8 | 108185265 | 4 | 4 | 3m 52s | 168 |
| #9 | kazvin.tjakradinata | 2 | 3 | 0m 30s | 160 |
| #10 | chunxiangxu.cxu | 2 | 2 | 0m 41s | 159 |
Items per page:
10
1 – 10 of 58
APFIVE