I also seem to recall that as of JDK 1.4,
String a = b + c + d;
is converted by the compiler to:
String a = new StringBuffer().append(b).append(c).append(d);
Not as terrible as it seems at first blush and a lot more readable.
Of course, no discussion of optimization should occur without considering
Knuth's statement, "Premature optimization is the root of all evil." Make
sure you actually need these benefits before you spend too much time on
them, especially as optimized code is sometimes less readable.
K.C.