Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.*;

public class Main {
    public static Object[] enumToArray(Enumeration e) {
        return enumToCollection(e).toArray();
    }

    public static Collection enumToCollection(Enumeration e) {
        ArrayList result = new ArrayList();
        while (e.hasMoreElements()) {
            result.add(e.nextElement());
        }
        return result;
    }
}