文章目录
String数据结构限制
Java中String用char value[]
存储:
/** The value is used for character storage. */
private final char value[];
String长度length()
取自数组长度,返回类型是int
/**
* Returns the length of this string.
* The length is equal to the number of <a href=" ">Unicode
* code units</a > in the string.
*
* @return the length of the sequence of characters represented by this
* object.
*/
public int length() {
return value.length;
}
<