Question: what is the difference between size and capacity of a vector?
Answer: What is the difference between size and capacity of a Vector in Java? The size of a vector represents the number of components in the vector. The capacity of a vector represents the maximum number of elements the vector can hold.