Online Java Compiler By
JavaTpoint.com
import java.util.*; public class VectorGetExample3 { public static void main(String arg[]) { //Create an empty vector Vector
vecObject = new Vector
(); //Add element in the vector vecObject.add(11); vecObject.add(22); vecObject.add(33); //Get the element at specified index System.out.println("Element at index 5 is = "+vecObject.get(5)); } }
Output