Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.Enumeration; public class Main { public static <A, E extends A> A[] toArray(Enumeration<E> enumeration, A[] array) { ArrayList<A> elements = new ArrayList<A>(); while (enumeration.hasMoreElements()) elements.add(enumeration.nextElement()); return elements.toArray(array); } }