0
点赞
收藏
分享

微信扫一扫

Integer类之equals与hashCode

伢赞 2022-08-03 阅读 106
编程语言

一、源码。

1、equals源码。可以看出,比较的是两者的类型相同且内容相同。即是否有相等的int类型的value值。

Integer类之equals与hashCode_其它

##############################################################################################

Integer类之equals与hashCode_其它_02

##############################################################################################

Integer类之equals与hashCode_其它_03

 

2、hashCode源码。可以看出Integer对象的哈希值是其存储的int类型的value值大小

 

Integer类之equals与hashCode_其它_04

###############################################################################################

Integer类之equals与hashCode_其它_05

 

二、


举报

相关推荐

0 条评论