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.Collections;

public class Main {

    public static <T> ArrayList<T> toArrayList(T[] items) {
        if (items == null || items.length == 0) {
            return null;
        }
        ArrayList<T> list = new ArrayList<>();
        Collections.addAll(list, items);
        return list;
    }
}