Get element from vector

E elementAt(int index)
Returns the component at the specified index.
E firstElement()
Returns the first component (the item at index 0) of this vector.
E get(int index)
Returns the element at the specified position in this Vector.
E lastElement()
Returns the last component of the vector.

import java.util.Arrays;
import java.util.Enumeration;
import java.util.Vector;

public class Main{

  public static void main(String args[]) {

    Vector v = new Vector();

    v.add(" 1");
    v.add(" 2");
    v.add(" 3");


The output: 3
  Java Book 

  1. Vector class
  2. Create Vector objects
  3. Add elements to this vector
  4. Size and capacity
  5. Remove all elements from a vector
  6. Clone a vector
  7. Does it contain a certain element
  8. Copy elements in vector to an array
  9. Get Enumeration from this vector
  10. Compare two vectors
  11. Get element from vector
  12. Is vector empty
  13. Get element index
  14. Remove element from a vector
  15. Retain elements collection c has
  16. Replace element in a vector
  17. Get a sub list from a list
  18. Convert Vector to Array