Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsListExample1 { public static void main(String[] args) { //Create vector and array list List
arrlist = new ArrayList
(); Vector v = new Vector(); //Populate the vector v.add("A"); v.add("B"); v.add("C"); v.add("D"); v.add("E"); //Create enumeration Enumeration e = v.elements(); //Get the list arrlist = Collections.list(e); System.out.println("Value of returned list: "+arrlist); } }
Output