》StringBuffer,线程安全的
public final class StringBuffer extends AbstractStringBuilder implements
Appendable, Serializable, CharSequence {
public StringBuffer() {
}
public synchronized StringBuffer append(String string) {
append0(string);
return this;
}
》StringBuilder,线程不安全的
public final class StringBuilder extends AbstractStringBuilder implements
Appendable, CharSequence, Serializable {
public StringBuilder() {
}
public StringBuilder append(String str) {
append0(str);
return this;
}
》String,线程安全的
public final class String implements Serializable, Comparable<String>, CharSequence {
public String() {
value = EmptyArray.CHAR;
offset = 0;
count = 0;
}