Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static List<Integer> asList(int[] a) { List<Integer> result = new ArrayList<Integer>(a.length); for (int i = 0; i < a.length; i++) { result.add(Integer.valueOf(a[i])); } return result; } public static List<Double> asList(double[] a) { List<Double> result = new ArrayList<Double>(a.length); for (double v : a) { result.add(new Double(v)); } return result; } }