获取对象的哈希值。
所有的对象都有哈希值。哈希值能确保对象相同,
当使用==
操作符比较时,结果相等。
除了在运行期间不一致,不能确定哈希值。
这两句感觉有歧义,原文如下,如果翻译不对请指正:
Other than that there are no guarantees about the hash codes.
They will not be consistent between runs and there are no distribution guarantees.
如果子类重写hashCode,它也应该重写相等操作符,以保持一致。