Correct Answer - Option 1 : Vectors
Concept:
Dynamic arrays are those arrays that are allocated memory at the run time with the help of a heap. Thus Dynamic array can change its size during run time
A dynamic array expands as you add more elements. So you don't need to determine the size ahead of time.
Vector is like a dynamic array that can grow or shrink its size. Unlike an array, we can store n-number of elements in it as there is no size limit. It is a part of the Java Collection framework since Java 1.2. It is found in java.util package and implements the List interface, so we can use all the methods of the List interface here. It is similar to the ArrayList, but with two differences-
- Vector is synchronized.
- Java Vector contains many legacy methods that are not part of a collections framework.
Java Vector class Declaration
public class Vector<E>
extends Object<E>
implements List<E>, Cloneable, Serializable
Hence the correct answer is option 1