Get Vector elements

There are many methods to retrieve or get element from Vector Object get(int index); Object firstElement(); Object elementAt(int index); Object get(int index) We can use get(int index) method for retrieving the element from Vector It returns the value present at the specified index This method throws IndexOutOfBoundsException if the index is less than zero or […]

Share this article on

Remove Vector elements

We can use remove() method of Vector to delete/remove elements from Vector There are 7 different “remove” methods defined in Vector 1) Object remove(int index); 2) boolean remove(Object o); 3) boolean removeAll(Collection c); 4) boolean removeAllElements(); 5) boolean removeElement(Object o); 6) void removeElementAt(int index); 7) protected void removeRange(int fromIndex, int toIndex); Object remove(int index) Removes […]

Share this article on
< Previous Next >