Get Enumeration from this vector

ReturnMethodSummary
Enumeration<E>elements()Returns an enumeration of the components of this 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("java2s.com");
    v.add("java2s.com");
    v.add("java2s.com");
    
    Enumeration e = v.elements();
    while(e.hasMoreElements()){
      System.out.println(e.nextElement());
    }
  }
}

The output:


java2s.com
java2s.com
java2s.com
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.