相关疑难解决方法(0)

理解奇怪的Java哈希函数

以下是哈希函数的源代码java.util.HashMap.评论很好地解释了它的成就.但怎么样?什么是^>>>运营商在做什么?有人可以解释代码实际上如何评论所说的内容吗?

/**
 * Applies a supplemental hash function to a given hashCode, which
 * defends against poor quality hash functions.  This is critical
 * because HashMap uses power-of-two length hash tables, that
 * otherwise encounter collisions for hashCodes that do not differ
 * in lower bits. Note: Null keys always map to hash 0, thus index 0.
 */
static int hash(int h) {
    // This function ensures …
Run Code Online (Sandbox Code Playgroud)

java hash

33
推荐指数
3
解决办法
7243
查看次数

标签 统计

hash ×1

java ×1