StringBuffer supports a modifiable string. As you know from previous tutorials, strings represent the fixed length, unchanging character sequences.
The default constructor reserves 16 characters without reallocation.
The second version adopts an integer argument that clearly determines the size of the buffer.
The third version adopts a String argument that sets the initial contents of the StringBuffer object and saves space for 16 more characters without reallocation. StringBuffer allocates room 16 extra characters when no specific buffer lengths are requested because rescheduling is a costly process over time. Also, frequent rearrangements can fragment memory. StringBuffer reduces the number of reassignments that occur by allocating room for a few additional characters.
The fourth constructor creates an object that contains 16 more letters in alphabetical order and the order save room.