StringBuffer in Java
StringBuffer in Java
- StringBuffer will represent the sequence of characters.
- It is the same line String, but the difference in the nature of the string and string buffer.
- A StringBuffer is mutable whereas StringBuffer is immutable in nature.
- Once we create a string object, we cannot manipulate on the string object. We can manipulate the String buffer object.
- A string buffer is growable in nature – Dynamically we can increase and decrease the size of the buffer
- Creating a String buffer
Syntax
StringBuffer sb=new StringBuffer();
Click Here-> Get Java Training with Real-time Projects