On Java String Concatenation
Most Java programmers know to use a StringBuffer (or a JDK 1.5 StringBuilder) when concatenating Strings in Java, but it occurred to me that the compiler might be able to optimize some of these calls. For instance, look at the following code: StringBuffer buf = new StringBuffer(); buf.append(“one” + “two”); There is an obvious optimization … Continue reading On Java String Concatenation