# What is the default capacity of HashMap?

**capacity**of an

**HashMap**is the number of buckets in the hash table. The

**initial capacity**is the

**capacity**of an

**HashMap**at the time of its creation. The

**default initial capacity**of the

**HashMap**is 2

^{4}i.e 16.

Click to see full answer

Thereof, what is the default capacity of a vector?

**Vector**: Constructs an empty **vector** so that its internal data array has **size** 10 and its standard **capacity** increment is zero. HashMap: Constructs an empty HashMap with the **default initial capacity** (16) and the **default** load factor (0.75).

Likewise, what is the default size of load factor in hashing based collection? **Default** initial **capacity** of the HashMap takes is 16 and **load factor** is 0.75f (i.e 75% of current map **size**). The **load factor** represents at what level the HashMap **capacity** should be doubled.

Also, why is the bucket size 16 by default in HashMap?

This code block defines the **default size** of an array as **16** (always a power of 2) and the load factor as 0.75, so that the **HashMap's capacity** will double in **size** by recomputing the hashcodes of the existing data structure elements any time the **HashMap** reaches 75% (in this case 12) of its current **size** (**16**).

What is the default capacity of a ArrayList?

**Default initial capacity** of **ArrayList** is 10. java. util. **ArrayList** defines private static final variable DEFAULT_CAPACITY to define **initial capacity** of **ArrayList**.