String , StringBuffer or StringBuilder , which one to use for Better Performance?

String , StringBuffer or StringBuilder , which one to use for Better Performance?

  • perf-test.com need your contributions to build up a strong repository of performance engineering resources.

Vaibhav

Administrator
Staff member
Dec 10, 2015
21
1
3
36
Vaibhav submitted a new resource:

String , StringBuffer or StringBuilder , which one to use for Better Performance? - Difference between String , StringBuffer and StringBuilder

String
1. String is immutable ( once created can not be changed )object. The object created as a String is stored in the Constant String Pool .
Every immutable object in Java is thread safe ,that implies
2. String is also thread safe.
3. String can not be used by two threads simultaneously.
4. String once assigned can not be changed.

String demo = " hello " ;
// The above object is stored in constant string pool and its value can not be modified.
demo="Bye" ;...

Read more about this resource...