Java tutorial
//package com.java2s; /* Copyright 2004 - 2007 Kasper Nielsen <kasper@codehaus.org> Licensed under * the Apache 2.0 License, see http://coconut.codehaus.org/license. */ import java.util.ArrayList; import java.util.Collection; public class Main { public static Collection<Integer> asList(int... data) { ArrayList<Integer> list = new ArrayList<Integer>(data.length); for (int i : data) list.add(i); return list; } }