It was an interview question. I was asked to implement the StringBuffer append function. I saw the code after the interview. But I cannot understand how the operati
StringBuffer
String is immutable. Appending a string can only generate a new string.
String
StringBuilder is mutable. Appending to a StringBuilder is an in-place operation, like adding to an ArrayList.
StringBuilder