Multiple choice

What is the initial capacity of vector?

  1. 16

  2. 10

  3. 20

  4. 12

  5. 18

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

This is the correct choice because the default constructor of Vector class will create a vector with a default initial capacity 10. Vector v1 = new Vector(): This will create a vector with initial capacity 10. You can check this by v1.capacity(). So, this is the correct answer.