Online Java Compiler By
JavaTpoint.com
import java.util.*; public class VectorRemoveElementAtExample3 { public static void main(String arg[]) { //Create an empty vector Vector
vec = new Vector<>(); //Add elements in the vector vec.add(9); vec.add(8); vec.add(7); //Remove an element vec.removeElementAt(50); //Displaying the vector element after removal System.out.println("Vector element after removal: " +vec); } }
Output