Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Collection;
import java.util.List;

public class Main {
    public static <E> Collection<E> List2Collection(List<E> elements) {
        if (elements == null || elements.size() <= 0) {
            return null;
        }
        Collection<E> collections = elements;
        for (E e : elements) {
            collections.add(e);
        }

        return collections;
    }
}