Here you can find the source of asList(int[] ar)
public static List<Integer> asList(int[] ar)
//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[] ar) { List<Integer> list = new ArrayList<Integer>(ar.length); for (int a : ar) list.add(a);/* w w w . ja va 2 s. com*/ return list; } public static double[] add(double[] a, double b) { for (int i = 0; i < a.length; i++) { a[i] += b; } return a; } public static double[] add(double[] a, double scale, double[] b) { for (int i = 0; i < a.length; i++) { a[i] += scale * b[i]; } return a; } }