Vector removeElementAt() Method in Java Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The java.util.vector.removeElementAt(int index) method is used to remove an element from a Vector from a specific position or index. In this process the size of the vector is automatically reduced by one and all other elements after the removed element are shifted downwards by one position. Syntax: Vector.removeElementAt(int index) Parameters: This method accepts a mandatory parameter index of integer data type which specifies the position of the element to be removed from the Vector. Return Value: This method has void return type. It means it does not return anything. Below program illustrate the Java.util.Vector.remove(int index) method: Java // Java code to illustrate removeElementAt() import java.util.*; public class VectorDemo { public static void main(String args[]) { // Creating an empty Vector Vector<String> vec_tor = new Vector<String>(); // Use add() method to add elements in the Vector vec_tor.add("Geeks"); vec_tor.add("for"); vec_tor.add("Geeks"); vec_tor.add("10"); vec_tor.add("20"); // Output the Vector System.out.println("Vector: " + vec_tor); // Initial size System.out.println("The initial size is: " + vec_tor.size()); // Remove the element at 3rd position vec_tor.removeElementAt(2); // Print the final Vector System.out.println("Final Vector: " + vec_tor); // Final size System.out.println("The final size is: " + vec_tor.size()); } } Output:Vector: [Geeks, for, Geeks, 10, 20] The initial size is: 5 Final Vector: [Geeks, for, 10, 20] The final size is: 4 Time complexity: O(n). // n is the size of the vector.Auxiliary Space: O(1). Comment K kundankumarjha Follow 0 Improve K kundankumarjha Follow 0 Improve Article Tags : Misc Java Java-Collections Java - util package Java-Functions Java-Vector +2 More Explore Java BasicsIntroduction to Java3 min readJava Programming Basics9 min readJava Methods6 min readAccess Modifiers in Java4 min readArrays in Java7 min readJava Strings8 min readRegular Expressions in Java3 min readOOP & InterfacesClasses and Objects in Java9 min readAccess Modifiers in Java4 min readJava Constructors4 min readJava OOP(Object Oriented Programming) Concepts10 min readJava Packages7 min readJava Interface7 min readCollectionsCollections in Java12 min readCollections Class in Java13 min readCollection Interface in Java4 min readIterator in Java5 min readJava Comparator Interface6 min readException HandlingJava Exception Handling6 min readJava Try Catch Block4 min readJava final, finally and finalize4 min readChained Exceptions in Java3 min readNull Pointer Exception in Java5 min readException Handling with Method Overriding in Java4 min readJava AdvancedJava Multithreading Tutorial3 min readSynchronization in Java10 min readFile Handling in Java4 min readJava Method References9 min readJava 8 Stream Tutorial7 min readJava Networking6 min readJDBC Tutorial5 min readJava Memory Management4 min readGarbage Collection in Java6 min readMemory Leaks in Java3 min readPractice JavaJava Interview Questions and Answers15+ min readJava Programs - Java Programming Examples7 min readJava Exercises - Basic to Advanced Java Practice Programs with Solutions5 min readJava Quiz1 min readJava Project Ideas For Beginners and Advanced15+ min read Like