关于hashcode的作用
摘要:假如你要将某对象存入hash相应的集合中(比如hashSet)时,是根据对象的hashcode来判断是否为同一对象的,一般默认hashcode是根据对象地址来算出的,而equals方法默认也是判断两对象地址是否相等,所以一般如果不重写equals方法,hashcode方法也不改写,而如果改写了e...
阅读全文
posted @ 2014-10-07 22:00
posted @ 2014-10-07 22:00
|
|||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
---|---|---|---|---|---|---|---|---|---|
23 | 24 | 25 | 26 | 27 | 28 | 1 | |||
2 | 3 | 4 | 5 | 6 | 7 | 8 | |||
9 | 10 | 11 | 12 | 13 | 14 | 15 | |||
16 | 17 | 18 | 19 | 20 | 21 | 22 | |||
23 | 24 | 25 | 26 | 27 | 28 | 29 | |||
30 | 31 | 1 | 2 | 3 | 4 | 5 |
Powered by:
博客园
Copyright © 2025 heysong
Powered by .NET 9.0 on Kubernetes