import java.util.Enumeration;运行时:
导入 java.util.Vector;
public class Iterate_Vector_Enumeration {
public static void main(String[] args) {
Vectorvct = new Vector ();
//添加元素
vct.add(first”);
vct.add(第二”);
vct.add(第三”);
vct.add(第四”);
枚举<字符串> enm = 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.