EnumerationExample
import java.util.Enumeration;
import java.util.Vector;
public class EnumerationExample {
public static void main(String[] args) {
Vector<String> cityList = new Vector<String>();
cityList.add("Delhi");
cityList.add("Agra");
cityList.add("Bangalore");
cityList.add("Kerala");
cityList.add("Pune");
// At beginning cursor will point to index just before the first element in vector
Enumeration<String> enm = cityList.elements();
while(enm.hasMoreElements()) {
String city = enm.nextElement();
System.out.println(city);
}
}
}