StringBuffer - ayushmathur94/DirectQuesAns_Prep GitHub Wiki

StringBuffer Class:

StringBuffer is a peer class of String that provides much of the functionality of strings. The string represents fixed-length, immutable character sequences while StringBuffer represents growable and writable character sequences. StringBuffer may have characters and substrings inserted in the middle or appended to the end. It will automatically grow to make room for such additions and often has more characters preallocated than are actually needed, to allow room for growth. In order to create a string buffer, an object needs to be created, (i.e.), if we wish to create a new string buffer with name str, then:

StringBuffer str = new StringBuffer();

StringBuilder

StringBuilder Defination is same as StringBuffer.

StringBuilder str = new StringBuilder();

⚠️ **GitHub.com Fallback** ⚠️