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

public class Main {

    public static List<Integer> toCollection(int[] intIds) {
        List<Integer> integerIds = new ArrayList<Integer>();
        for (int intId : intIds) {
            integerIds.add(new Integer(intId));
        }
        return integerIds;
    }

    public static <T> List<T> toCollection(T[] objects) {
        List<T> destObjects = new ArrayList<T>();
        for (T object : objects) {
            destObjects.add(object);
        }
        return destObjects;
    }
}