String类有数据成员吗

小C哈哈哈 2017-11-12 06:03:12
String类有数据成员吗
...全文
212 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
有有有有有有有。源码
lcyzc 2017-11-14
  • 打赏
  • 举报
回复
有的,多看看源码,API文档
自由自在_Yu 2017-11-14
  • 打赏
  • 举报
回复
public final class String
    implements java.io.Serializable, Comparable<String>, CharSequence
{
    /** 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;

    /** Cache the hash code for the string */
    private int hash; // Default to 0

    /** use serialVersionUID from JDK 1.0.2 for interoperability */
    private static final long serialVersionUID = -6849794470754667710L;
小C哈哈哈 2017-11-13
  • 打赏
  • 举报
回复
对于Hahset集合中的元素因为是无序的,那么它是通过哈希码来确定位置的吗
饺克力克 2017-11-12
  • 打赏
  • 举报
回复
李德胜1995 2017-11-12
  • 打赏
  • 举报
回复
看源码。。。。。。。。

62,615

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧