Which of the following is false for vector class?

Options
- The size of a Vector is static
- The Vector class implements an incremental array of objects.
- The vector components can be accessed using an integer index.
- The size of a Vector increases or decreases as needed to accommodate the items.


CORRECT ANSWER : The size of a Vector is static

Discussion Board
Vector Class

The size of the vector is never be static so the statement is false reason behind it is: Vector implements a dynamic array. It is similar to ArrayList, but having the differences listed below:

1. It is synchronized.

2. It consists of many legacy methods that are not part of the collections framework.

Vector are used when the size of the array is not known in advance or the changes are required in the array during the lifetime of the program.

Rohit Sharma 08-14-2014 07:50 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement