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
StringBuffer sb=new StringBuffer();