Enumeration
Wednesday, 22 June 2011
import java.util.*;
public class EnumerationDemo {
public static void main(String[] args) {
Vector v=new Vector();
for(int i=0;i<10;i++){
v.addElement(i);
}
Enumeration e=v.elements();
while(e.hasMoreElements()){
Integer g=(Integer) e.nextElement();
System.out.println(g);
}
/*while(e.hasMoreElements()){
System.out.println(e.nextElement());
}*/
}
}
public class EnumerationDemo {
public static void main(String[] args) {
Vector v=new Vector();
for(int i=0;i<10;i++){
v.addElement(i);
}
Enumeration e=v.elements();
while(e.hasMoreElements()){
Integer g=(Integer) e.nextElement();
System.out.println(g);
}
/*while(e.hasMoreElements()){
System.out.println(e.nextElement());
}*/
}
}
0 comments:
Post a Comment