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
What about
new String(new char[] {a, b})
and if you do it alot you could create a class "Strings" with:
public static String valueOf(char... chars) {
return new String(chars);
}
Your line would then read
String s = Strings.valueOf(a, b);
Nice and short.
Edited
A better name might be:
String s = Chars.asString(a, b);