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 Integer[] toIntegerArray(int[] array) {
        if (array == null) {
            return null;
        }

        List<Integer> newArray = new ArrayList<Integer>();

        final int N = array.length;

        for (int i = 0; i < N; i++) {
            newArray.add(array[i]);
        }

        return newArray.toArray(new Integer[0]);
    }
}