I was asked a question. If you had to build an XML structure as text, would you use StringBuffer or String? I thought String is more efficient that StringBuffer, but some of my friends say StringBuffer is more efficient than String.
I assume, that StringBuffer is a class, where as String is a base datatype and StringBuffer would have some easy (wrapper) methods for String. So, it is an add-on to string. Which should make StringBuffer heavier than String. Then how come using StringBuffer better than String?