Answers for "diff between string and stringbuilder in java"

2

java string vs stringbuilder

A String can be used when immutability is required, or concatenation operation is not required. A StringBuilder can be used when a mutable string is needed without the performance overhead of constructing lots of strings along the way.
Posted by: Guest on September-06-2021
3

string vs stringbuffer

The main similarity between String and StringBuffer class is that both are
thread safe. 
The main difference is that String is immutable; StringBuffer is mutable.
Posted by: Guest on December-05-2020
1

stringbuffer vs stringbuilder vs string in java

The StringBuffer and StringBuilder class both produces mutable string objects.
 The main difference between them is that StringBuffer is thread safe;
 StringBuilder is not thread safe.
String is immutable and thread safe.
We are using StringBuffer when we are doing parallel
testing since it is a thread safe.
Posted by: Guest on January-05-2021

Code answers related to "diff between string and stringbuilder in java"

Browse Popular Code Answers by Language