DRAFT
StringRepetitionOperator
Incorrect
The multiplication operator can repeat a String a number of times
Correct
The multiplication operator does not accept a String and a number
CorrectionHere is what's right.
Here is what's right.
Java’s multiplication operator only works for numbers. It does not support the repetition of Strings. To repeat a String a given number of times, one can use a loop.
OriginWhere could this misconception come from?
Where could this misconception come from?
If students previously learned Python, they may inappropriately transfer this idea from Python (where such an operator exists) to Java.
Language
Java