Multiple choice

What is the size and capacity of the Vector Num in the following code? Vector Num=new Vector(10)

  1. Size = 10, capacity = 0

  2. Size = 0, capacity = 10

  3. Size = 10, capacity = 10

  4. Size = 0, capacity = 0

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

The number of elements in the vector represents the size of the vector and the maximum number of elements stored in the vector is the capacity of the vector that is 10 in this case.