What is the difference between StringBuffer and Stringuilder?
All the methods in StringBuffer are synchronized when necessary, while those in StringBuilder are not.
extended by java.lang.StringBuffer
All Implemented Interfaces:
Serializable, Appendable, CharSequence
StringBuffer class is safe for use by multiple threads. The methods are synchronized where necessary so that all the operations on any particular instance behave as if they occur in some serial order that is consistent with the order of the method calls made by each of the individual threads involved.