In the vector class it implements the array of the objects and classes in the java packages with colections and it is found in java.util packages in the list interface in the list methods.it can implement the vector components in dynamic array it can grow or shrink in the array list.
import java.io.*; import java.util.*; class GFG { public static void main(String[] args) { int n = 5; Vector<Integer> v = new Vector<Integer>(n); for (int i = 1; i <= n; i++) v.add(i); System.out.println(v); v.remove(3); System.out.println(v); for (int i = 0; i < v.size(); i++) System.out.print(v.get(i) + " "); } }
output:- [1, 2, 3, 4, 5] [1, 2, 3, 5] 1 2 3 5