50,526
社区成员
发帖
与我相关
我的任务
分享
/**
* Initializes a newly created {@code String} object so that it represents
* an empty character sequence. Note that use of this constructor is
* unnecessary since Strings are immutable.
*/
public String() {
this.value = "".value;
}
其实他的注释写了,初始化自己为一个空的char集合 /** The value is used for character storage. */
private final char value[];
this.value = "".value
就是把空字符串的value数组赋值给自己的value数组,这样自己其实就是""了