String类有数据成员吗

[复制链接]
查看11 | 回复6 | 2021-1-27 06:32:09 | 显示全部楼层 |阅读模式
String类有数据成员吗
分 -->
回复

使用道具 举报

千问 | 2021-1-27 06:32:09 | 显示全部楼层
看源码。。。。。。。。




回复

使用道具 举报

千问 | 2021-1-27 06:32:09 | 显示全部楼层



回复

使用道具 举报

千问 | 2021-1-27 06:32:09 | 显示全部楼层
对于Hahset集合中的元素因为是无序的,那么它是通过哈希码来确定位置的吗
回复

使用道具 举报

千问 | 2021-1-27 06:32:09 | 显示全部楼层
有的,多看看源码,API文档
回复

使用道具 举报

千问 | 2021-1-27 06:32:09 | 显示全部楼层
有有有有有有有。源码
回复

使用道具 举报

千问 | 2021-1-27 06:32:09 | 显示全部楼层
publicfinalclassString
implementsjava.io.Serializable,Comparable,CharSequence
{
/**Thevalueisusedforcharacterstorage.*/
privatefinalcharvalue[];
/**Theoffsetisthefirstindexofthestoragethatisused.*/
privatefinalintoffset;
/**ThecountisthenumberofcharactersintheString.*/
privatefinalintcount;
/**Cachethehashcodeforthestring*/
privateinthash;//Defaultto0
/**useserialVersionUIDfromJDK1.0.2forinteroperability*/
privatestaticfinallongserialVersionUID=-6849794470754667710L;
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行