We will find answer for following questions
- What is StringBuffer
- Available Constructors
- Commonly used methods
- Java StringBuffer class is used to create mutable (modifiable) string.
- The StringBuffer class in java is same as String class except it is mutable i.e. it can be changed.
- The Java StringBuffer class is same as StringBuilder class except that this one is synchronized.
- So its thread safe and can be used if Object are shared among multiple thread.
- If sb refers to an instance of a StringBuffer, then sb.append(x) has the same effect as sb.insert(sb.length(), x).