- Question: What is the default capacity of
- Answer: It is exactly 10.
Why not any power of 2? Well, Sun engineers believed after long and costly research, that 10 is the best number You can pick. What is more curious, default initial capacity of
java.util.HashMapis 16, which makes more sense.
What do You think, something is missing here? Is 10 really a perfect fit for array type collections?