The difference between String StringBuilder StringBuffer ~~~
String is a string constant, once created, it cannot be changed;
StringBuilder and StringBuffer are string variables that can be increased or decreased later;
StringBuilder is thread-unsafe, and the method implementation in it does not use the keyword synchronized, which is suitable for single-threaded use;
StringBuffer is thread-safe, and the methods in it are implemented using the synchronized keyword, which is suitable for multi-threading.
Running speed: String < StringBuffer < StringBuilder
eg:StringBuilder sb = new StringBuilder().append("abc").append("bcd");
System.out.println(StringBuilder.toString(sb));