Fourth way: the difference and usage scenarios of String, StringBuffer, StringBuilder

Question: What are the differences and usage scenarios of String, StringBuffer, and StringBuilder?

answer:

When the variable is used as a shared variable, it is multi-threaded and the result is correct. Use stringbuffer

Guess you like

Origin blog.csdn.net/qq_35207086/article/details/114398790