The StringBuffer class enables you to create String objects that can be changed in various ways, unlike the String class, which are immutable. When you modify a string of the StringBuffer class, you're not creating a new String object, but rather operating directly on the original string itself. For this reason, the StringBuffer class offers a different set of methods than the String class, all of which operate directly on the buffer that contains the string.
The StringBuffer class offers several constructors that enable you to construct a StringBuffer object in various ways. Those constructors look like this:
StringBuffer() StringBuffer(int length) StringBuffer(String str)
These constructors ...