Java examples for Collection Framework:Vector
How to get Enumeration over Java Vector using enumeration method of Collections class.
import java.util.Enumeration; import java.util.Vector; import java.util.Collections; public class Main { public static void main(String[] args) { Vector v = new Vector(); // ww w.j av a2 s. com v.add("A"); v.add("B"); v.add("D"); v.add("E"); v.add("F"); Enumeration e = Collections.enumeration(v); System.out.println("Enumerating through Java Vector"); while(e.hasMoreElements()) System.out.println(e.nextElement()); } }