A StringBuffer
or its younger and faster brother StringBuilder
is preferred whenever you're going do to a lot of string concatenations in flavor of
string += newString;
or equivalently
string = string + newString;
because the above constructs implicitly creates new string everytime which will be a huge performance and drop. A StringBuffer
/ StringBuilder
is under the hoods best to be compared with a dynamically expansible List<Character>
.