//String
public final class String
implements java.io.Serializable, Comparable<String>, CharSequence {
/** The value is used for character storage. */
private final char value[];
}
//JDK中StringBuffer和StringBuilder都继承AbstractStringBuilder
abstract class AbstractStringBuilder implements Appendable, CharSequence {
/**
* The value is used for character storage.
*/
char[] value;
}
String 为字符串常量,StringBuffer、StringBuilder为字符串变量,即String对象一旦创建之后该对象是不可更改的,但后两者的对象是变量,是可以更改的。(他们三个都是不可变类)//代码来自JDK源码//String public final class String implements java.io.Serializable, Comparable...