Here you can find the source of asList(int[] a)
public static ArrayList asList(int[] a)
//package com.java2s; /*/* w ww . j a va2 s .com*/ * @(#)ArrayUtil.java * * Copyright (c) 2003-2010 Werner Randelshofer * Hausmatt 10, Immensee, CH-6405, Switzerland * All rights reserved. * * The copyright of this software is owned by Werner Randelshofer. * You may not use, copy or modify this software, except in * accordance with the license agreement you entered into with * Werner Randelshofer. For details see accompanying license terms. */ import java.util.*; public class Main { public static ArrayList asList(int[] a) { ArrayList list = new ArrayList(a.length); for (int i = 0; i < a.length; i++) { list.add(new Integer(a[i])); } return list; } }