【发布时间】:2021-04-12 06:11:19
【问题描述】:
根据 javadocs,map.entry 的哈希码定义为:
int hashCode()
Returns the hash code value for this map entry. The hash code of a map entry e is defined to be:
(e.getKey()==null ? 0 : e.getKey().hashCode()) ^
(e.getValue()==null ? 0 : e.getValue().hashCode())
请确认,是否使用按位异或运算符来计算映射条目的哈希码值?
【问题讨论】:
标签: java hashmap hashcode hash-code-uniqueness