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.

It’s advised to use StringBuffer or StringBuilder to concatenate String objects. However, the specification said that a “+” operator is rewritten by the Java Compiler into StringBuilder.