Java List from Array asList(int... data)

Here you can find the source of asList(int... data)

Description

as List

License

Open Source License

Declaration

public static Collection<Integer> asList(int... data) 

Method Source Code


//package com.java2s;
/* Copyright 2004 - 2008 Kasper Nielsen <kasper@codehaus.org>
 * Licensed under the Apache 2.0 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);//from w w w.j  a  v  a  2s .  co  m
        return list;
    }
}

Related

  1. asList(final T... data)
  2. asList(final T[] array)
  3. asList(final T[] input)
  4. asList(float[] elements)
  5. asList(int... array)
  6. asList(int... values)
  7. asList(int[] a)
  8. asList(int[] ai)
  9. asList(int[] ar)