javastaticintindexFor(inth,intlength){//assertInteger.bitCount(length)==1:"lengthmustbeanon-zeropowerof2";returnh&(length-1);}这是hashmap源码的一个函数,作用是将hashcode对应到hashmap数组里面的下标。`h&(length-1)`是什么运算呢?这样能保证下标是唯一的吗?
慕无忌1623718
呼如林
POPMUISE
随时随地看视频慕课网APP
相关分类