Let\'s say I have two char
variables, and later on I want to concatenate them into a string. This is how I would do it:
char c1, c2;
// ...
Str
I prefer using String.valueOf
for single conversions - but in your case you really want concatenation.
However, I would suggest that this version would remove all potential ambiguity:
String s = c1 + "" + c2;
That way there's no possibility, however remote, of someone considering whether c1 and c2 will be added together before the concatenation.