<<< String Data Type, cont. | Index | Java API >>> |
Operator + concatenates two strings or a string and a numeric value or character:
"The sum = " + 12 + 26
After this statement the text assigned to the str becomes:
"The sum = 1226";
Is this what you want? Maybe the intent was
"The sum = " + (12 + 26)
which yields
"The sum = 38"
<<< String Data Type, cont. | Index | Java API >>> |