public class TestEnumeration{
public static void main(String[] args){
Vector v = new Vector();
v.addElement("Lisa");
v.addElement("Billy");
v.addElement("Mr Brown");
Enumeration e = v.elements();//返回Enumeration对象
while(e.hasMoreElements()){
String value = (String)e.nextElement();//调用nextElement方法获得元素
System.out.print(value);
}
}
}

相关文章:

  • 2022-12-23
  • 2022-02-25
  • 2022-02-03
  • 2022-12-23
  • 2021-05-24
  • 2021-07-13
  • 2021-07-20
猜你喜欢
  • 2021-08-16
  • 2021-06-30
  • 2021-07-03
  • 2021-05-04
  • 2021-12-18
  • 2022-02-09
  • 2022-01-27
相关资源
相似解决方案