Possible duplicate:
Initial default Java HashMap capacity
I read the HashMap implementation in java.util.HashMap. Initial capacity, maximum capacity, etc. Equal to two.
Parts of an ad copied from java.util.HashMap
static final int DEFAULT_INITIAL_CAPACITY = 16;
static final int MAXIMUM_CAPACITY = 1 << 30;
transient Entry[] table;
Comments suggest that dimensions MUST be a force of two. Why is the power of two so important?
source
share