Java Interviews - Core Java - Q2 - StringBuffer vs StringBuilder
As part of my core Java interview preparation series, see: http://furikake.posterous.com/tag/corejavainterviewseries
Q2) String Buffer vs String Builder
My Answer: StringBuffer is synchronized and thus thread safe, it's slower than StringBuilder which is not guaranteed to be thread safe.
Read the javadocs...
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/StringBuffer.html
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/St...
↧