Optimization of String Concatenation An implementation may choose to perform conversion and concatenation in one step to avoid creating and then discarding an intermediate String object. To increase the performance of repeated string concatenation, a Java compiler may use the StringBuffer class or a similar technique to reduce the number of intermediate String objects that are created by evaluation of an expression.
184.108.40.206 Optimization of String Concatenation From this quote, creation of a StringBuffer is not ever guaranteed. I don't see an intermediate String object that can be discarded either. Assuming that the code beyond the discussed fragment didn't create String literals "abc" and "cde", there're 4 objects. [ October 07, 2003: Message edited by: Vad Fogel ]