Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.ArrayList;
import java.util.Collection;

public class Main {
    public static <T> Collection<T> arrayToCollection(final T[] array) {
        int length = array == null ? 0 : array.length;
        ArrayList<T> al = new ArrayList<T>(length);
        for (int i = 0; i < length; i++) {
            al.add(array[i]);
        }
        return al;
    }
}