Didn't see you were CCing the list when I responded in private mail,
sorry.

>>>>> "BS" == Ben Speakmon <[EMAIL PROTECTED]> writes:

 BS> not quite - for every '+' operator, the compiler creates a
 BS> StringBuffer, appends the right operand, and does a toString() on
 BS> the buffer. For multiple concats (i.e., "x is " + x + " and y is"
 BS> + y) you get five object creations on each '+'.  SLOOOOW.

Yes you are right for

String a = "x" + "y";
a += "z";

but

String a = "x" + "y" + "z";

will be as fast as 

String a = new StringBuffer("x").append("y").append("z").toString();

and a lot more readable to most people. 

Stefan

Reply via email to