Multiple choice technology programming languages

Vector.size() refers to the space alloted to the vector

  1. True

  2. False

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

In Java's Vector class, size() returns the number of elements currently stored, while capacity() returns the total allocated space. The size is always <= capacity. The question incorrectly conflates size with allocated space - size() tracks actual elements, not memory allocation.