Log in

View Full Version : Differentiate between StringBuffer and StringBuilder in Java programming.



dennis123
11-21-2017, 06:07 AM
Differentiate between StringBuffer and StringBuilder in Java programming.

DanielDP
11-22-2017, 04:23 AM
StringBuffer class is synchronous. This means that two threads can not call concurrent methods of the StringBuffer class.

StringBuilder is non-synchronized. This means that two threads can call concurrent methods of the StringBuilder class

davidsmith21
11-24-2017, 03:01 AM
Changeability Difference: String is permanent, in the event that you attempt to modify their qualities, another question gets made, though StringBuffer and StringBuilder are impermanent so they can change their qualities. String Safety Difference: The distinction amongst StringBuffer and StringBuilder is that StringBuffer is string safe.

EdSim
11-24-2017, 08:14 AM
StringBuffer is mutable means one can change the value of the object . The object created through StringBuffer is stored in the heap . StringBuffer has the same methods as the StringBuilder , but each method in StringBuffer is synchronized that is StringBuffer is thread safe .