Welcome to the Simplilearn Community

Want to join the rest of our members? Sign up right away!

Sign Up

difference between string buffer and string builde...

Girish Kumar S

Well-Known Member
Trainer
First lets see the similarities..
Both StringBuffer and StringBuilder are mutable
and the main difference is :
StringBuffer is synchronized while StringBuilder is not which makes StringBuilder faster than StringBuffer.
 

raju.chautagi(3162236)

New Member
Alumni
StringBuffer is thread safe and StringBuilder is not, hence when you need to honor or worry about thread safety you can choose StringBuffer else StringBuilder, in addition to details above.
 
Top