So I was reading String class when i stumbled on one confusing constructor. The code goes like this
public final class String
implements java.io.Serializable, Comparable<String>, CharSequence {
/** The value is used for character storage. */
private final char value[];
/** 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;
}
// the rest of the class code
}
I don't understand what does
"".value;
do. What is this ""
? Is it a new String object
? If it is, with what constructor?