Q&A
Q&AHow do String, StringBuilder, and StringBuffer differ?
String is immutable; builders are mutable, and StringBuffer synchronizes its methods.
Read the concise answer
String values are immutable and can be safely shared. StringBuilder supports mutable append operations without synchronization and is usually appropriate for thread-confined construction. StringBuffer synchronizes individual methods, but that does not automatically make a multi-call workflow atomic; synchronization often costs more than needed when a builder is local to one thread.