
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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
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.
Advertisements