Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;

public class Main {
    /**
     * Convert the given array into an ArrayList.
     * @param array
     * @param <T>
     * @return
     */
    public static <T> ArrayList<T> toArrayList(T[] array) {
        ArrayList<T> al = new ArrayList<T>();

        for (T item : array) {
            al.add(item);
        }

        return al;
    }
}