Vadim Nasardinov wrote:
StringBuffer is significantly faster than char[] in many cases.
Converting a char[] instance to a String via new String(char[]) always
involves copying.
Converting a StringBuffer to String via StringBuffer#toString()
involves no copying, provided the StringBuffer instance is never
mutated after you call toString() on it.
True. On the other hand, StringBuffer has extra non-trivial overhead,
including synchronization. Using StringBuilder reduces the overhead,
but doesn't remove it, and is Java5-specific. And char[] does have
semantics closer to Scheme strings.