StringBuffer public final class StringBuffer extends Object implements Serializable A string buffer implements a mutable sequence of characters. String buffers are safe for use by multiple threads. The methods are synchronized where necessary so that all the operations on any particular instance behave as if they occur in some serial order. The principal operations on a StringBuffer are the append and insert methods, which are overloaded so as to accept data of any type. Each effectively converts a given datum to a string and then appends or inserts the characters of that string to the string buffer.
Every string buffer has a capacity.
As long as the length of the character sequence contained in the string buffer does not exceed the capacity, it is not necessary to allocate a new internal buffer array. If the internal buffer overflows, it is automatically made larger. Constructs a string buffer with no characters in it and an initial capacity of 16 characters. Appends the string representation of the boolean argument to the string buffer. Appends the string representation of the char argument to this string buffer.