Some methods in StringBuffer are synchronized, and StringBuilder is not thread safe - and faster.
Rule of thumb - use StringBuilder if you have no use case where StringBuilder is used by more than one thread (this will be a very rare case).
source
share