String StringBuffer StringBuilder 的区别

【摘要】 1 StringString:字符串常量,字符串长度不可变。Java中String是immutable(不可变)的。String类的包含如下定义:[java] view plaincopy/** The value is used for character storage. */ private final char value[]; /** The offset is the f…

1 String

String:字符串常量,字符串长度不可变。Java中String是immutable(不可变)的。

String类的包含如下定义:

[java] view plaincopy

/** 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;  
  
/** The count is the number of characters in the String. */  
private final int count;  
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享