Differences between StringBuilder and StringBuffer

StringBuilder and StringBuffer are the most commanly used Java classes to handle String, here are some differences:

Differences between StringBuilder and StringBuffer

  1. StringBuffer is synchronized and hence thread safe. It means two or more threads can’t call the methods of StringBuffer simultaneously.
  2. StringBuffer is slow because it is thread safe where as StringBuilder is fast.
  3. StringBuffer was included in very first version of Java API, the JDK 1.0, while StringBuilder was included when JDK 1.5 was released.


Java Professional with rich experience in Java development.
– Designing and developing high-volume, low-latency applications with high-availability and performance.
– Writing well designed, robust and efficient code.

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *

LinkedIn Auto Publish Powered By : XYZScripts.com