Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsEnumerationExample2 { public static void main(String[] args) { //Create array list object List
Enum = new ArrayList
(); Enum.add(1100); Enum.add(2100); Enum.add(5100); //Create Enumeration Enumeration
en = Collections.enumeration(Enum); System.out.println("The Enumeration List are: "); while(en.hasMoreElements()){ System.out.println(en.nextElement()); } } }
Output