Privacy Policy Terms Of Use. Copyright © 2006-2010 Java Tutorials and Examples.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
1) Adding element to the end of the Vector
boolean add(Object element)
Appends specified element at the end of the Vector.
2) Insert element in the middle of the Vector
void add(int index, Object element)
Inserts specified element into the Vector at given index. This method can throw IndexOutOfBoundsException if index is out of range.
3) Append elements of a Collection to Vector
boolean addAll(Collection c)
Appends all elements of specified Collection to the Vector in order returned by the specified Collection’s Iterator.
4) Insert elements of a Collection to Vector
boolean addAll(int index, Collection c)
Inserts all elements of the specified collection into Vector at given index. This method can throw IndexOutOfBoundsException if index is out of range.
Replacing the specified element of the Vector
1) Object set(int index, Object element)
Replaces the element at specified index with the object passed as a parameter. Returns the previous element that has been replaced.
2) void setElementAt(Object element, int index)
Replaces the element at specified index with the object passed as a parameter.
<< Java Vector Search Elements Java Vector Get Remove Elements >>

Post new comment