0
我读过为了计算多维数组的哈希码,必须使用Arrays.deepHashCode()
方法而不是Arrays.hashCode()
方法,但我不太了解技术背后的原因。有人可以向我解释吗?当计算多维数组的散列码时使用Arrays.deepHashCode()的技术原因
Object[][] one = {
{1, 2, 3},
{11, 22, 33}
};
int two = Arrays.deepHashCode(one);
int three = Arrays.hashCode(one);
System.out.println("two " + two);
System.out.println("three " + three);
结果:
two 997365
three 312355675
非常感谢您的帮助。如果你不介意,你能否推荐一些关于学习hashcode的好资源?再次感谢您的帮助 – Thor
尝试一本关于Java数据结构和算法的好书。我没有具体的建议。 –