HashMap从Threshold到Integer numberOfLeadingZeros
为了易于理解HashMap的resize方法,我觉得还是先得弄懂Threshold是怎么来的。
首先看Threshold的JavaDoc
/**
* The next size value at which to resize (capacity * load factor).
*
* @serial
*/
在下一次resize时候的数组长度大小的值(c...
原创
2020-04-18 23:30:24 ·
309 阅读 ·
0 评论