Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;

import java.util.List;

public class Main {
    public static List<Integer> asIntegerList(int[] intArray) {
        ArrayList<Integer> result = new ArrayList<Integer>();
        if (intArray != null) {
            for (int integer : intArray) {
                result.add(integer);
            }
        }
        return result;
    }

    public static ArrayList<Integer> asIntegerList(String[] stringArray) {
        ArrayList<Integer> result = new ArrayList<Integer>();
        if (stringArray != null) {
            for (String string : stringArray) {
                result.add(Integer.valueOf(string));
            }
        }
        return result;
    }
}