Multiple choice technology programming languages

A Vector is declared as follows. What happens if the code tried to add 6 th element to this Vector new vector(5,10)

  1. The element will be successfully added

  2. ArrayIndexOutOfBounds Exception

  3. The Vector allocates space to accommodate up to 15 elements

  4. None of the above

Reveal answer Fill a bubble to check yourself
A,C Correct answer
Explanation

Vector(5,10) creates a Vector with initial capacity 5 and capacity increment 10. Adding a 6th element succeeds (Vector automatically grows) and capacity becomes 15 (5+10). Options B and D are incorrect.