* String class is an immutable class. As long as the String is modified, new objects will be generated.
* StringBuffer and StringBuilder are both mutable classes, and no new objects are generated by any changes to strings.
When using it in practice, if you often need to modify a string, such as insertion, deletion, etc.
* But what is the difference between StringBuffer and StringBuilder?
StringBuffer is thread-safe and is very convenient to use in multi-threaded programs, but the program's efficiency will be slower.
StringBuilder is not thread-safe and is more efficient than StringBuffer in a single thread.
* In general, the running time of the three:
String > StringBuffer > StringBuilder
The above article briefly talks about the difference between String StringBuffer and StringBuilder in Java is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.