由于笔试面试经常会问到这个问题,所以在这里先把这些问题搞清楚. String:自JDK1.0开始即有,源码中对String的描述: "Strings are constant; their values cannot be changed after they are created. String buffers support mutable strings." 由此我们可知String是常量,一个String对象一旦被创建它的值就不能改变,所以如果你创建了一个String对象,然…
1 String String:字符串常量,字符串长度不可变.Java中String是immutable(不可变)的. String类的包含如下定义: /** The value is used for character storage. */ private final char value[]; /** The offset is the first index of the storage that is used. */ private final int offset; /** Th…