Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsEnumerationExample1 { public static void main(String[] args) { Vector
Enum = new Vector
(); Enum.add("JAVA"); Enum.add("JSP"); Enum.add("SERVLET"); Enum.add("C"); Enum.add("PHP"); Enum.add("PERL"); //Create Enumeration Enumeration
en = Collections.enumeration(Enum); System.out.println("The Enumeration List are: "); while(en.hasMoreElements()){ System.out.println(en.nextElement()); } } }
Output