import java.util.Enumeration;Runtime:
import java.util.Vector;
public class Iterate_Vector_Enumeration {
public static void main(String[] args) {
Vectorvct = new Vector ();
//добавляем elements
vct.add("first");
vct.add("second");
vct.add("третий");
vct.add("четвертый");
Enumerationenm = vct.elements();
while(enm.hasMoreElements()){
System.out.println(enm.nextElement());
}
}
}
first
second
third
fourth
Please disable your ad blocker and refresh the window to use this website.