1.17 Class StringBuffer public  class  java.lang. StringBuffer extends  java.lang.
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.