Concatenation of Strings and characters

Viewed 2912

The following statements,

String string = "string";   

string = string +((char)65) + 5;
System.out.println(string);

Produce the output stringA5.


The following however,

String string = "string";

string += ((char)65) + 5;
System.out.println(string);

Produce string70.

Where is the difference?

5 Answers
Related