The difference between StringBuffer and StringBuilder are following:
StringBuffer is uses mutable String, all public methods are synchronized which makes it thread-safe but same time slow but In JDK 5 they provided StringBuilder which is copy of StringBuffer without synchronization.
StringBuilder is compatible with StringBuffer, but synchronization property is may not compatible.
StringBuilder is a little faster than StringBuffer.