What is the main difference between StringBuffer and StringBuilder? Is there any performance issues when deciding on any one of these?
StringBuffer
StringBuilder
A String is an immutable object which means the value cannot be changed whereas StringBuffer is mutable.
String
The StringBuffer is Synchronized hence thread-safe whereas StringBuilder is not and suitable for only single-threaded instances.