- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Why StringBuffer is mutable in Java?
85 Lectures 6 hours
We all know that the String class in Java is mutable i.e. once we create a String variable we cannot modify its data or do any manipulations.
But, there may be scenarios where we need to modify the data of String variables. In such cases, we could use StringBuffer class.
This class −
- is like a String, but can be modified.
- It contains some particular sequence of characters, but the length and content of the sequence can be changed through certain method calls.
- Is safe for use by multiple threads.
- Is StringBuffer final in Java?
- Java StringBuffer class.
- Why should we use a StringBuffer instead of a String in Java?
- What is the difference between StringBuffer and StringBuilder in java?
- Constructors of StringBuffer class in Java.
- Methods of StringBuffer class in Java.
- Mutable keyword in C++?
- C++ mutable keyword?
- Why is NullPointerException in Java?
- What is the difference between a StringBuffer and StringBuilder in java?
- Do you think Python Dictionary is really Mutable?
- Difference between StringBuilder and StringBuffer in Java
- Difference between string and StringBuffer in Java.
- Java String, StringBuffer and StringBuilder Tutorial.
- Java Program to Clear the StringBuffer