- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference between StringBuilder and StringBuffer in Java
StringBuilder is non-syncronized and thus is not threadsafe whereas StringBuffer is syncronized and threadsafe. But StringBuffer is slow in comparison to StringBuilder because of synchronization overhead.
StringBuffer should be used in the multithreaded environment whereas if only local variables are in scope or thread synchronization is not needed, StringBuilder is preferred.
- Related Articles
- Difference between StringBuffer and StringBuilder.
- What is the difference between StringBuffer and StringBuilder in java?
- What is the difference between a StringBuffer and StringBuilder in java?
- What is the difference between String, StringBuffer and StringBuilder classes in Java explain briefly?
- Java String, StringBuffer and StringBuilder Tutorial.
- Difference between string and StringBuffer in Java.
- Difference Between String and StringBuffer Class in Java
- Difference between String class and StringBuffer class in Java
- How can we compare a StringBuilder with StringBuffer in Java?
- Where to use a StringBuffer/StringBuilder than a String in Java?
- Difference between String and StringBuffer.
- Difference between String and StringBuilder in C#
- How to understand StringBuffer is thread-safe and StringBuilder is non-thread-safe in Java?\n
- What is the difference between a String object and a StringBuffer object in java?
- Differences between String and StringBuffer

Advertisements