Java List from Array asList(int[] arr)

Here you can find the source of asList(int[] arr)

Description

as List

License

Open Source License

Parameter

Parameter Description
arr a parameter

Declaration

public static List<Integer> asList(int[] arr) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Arrays;
import java.util.List;

public class Main {
    /**//from   ww  w .  j  ava 2s  .c  o  m
     *
     * @param arr
     * @return
     */
    public static List<Integer> asList(int[] arr) {
        Integer[] arrObj = new Integer[arr.length];
        for (int i = 0; i < arr.length; i++) {
            arrObj[i] = arr[i];
        }
        return Arrays.asList(arrObj);
    }
}

Related

  1. asList(int... data)
  2. asList(int... values)
  3. asList(int[] a)
  4. asList(int[] ai)
  5. asList(int[] ar)
  6. asList(int[] ints)
  7. asList(int[] list)
  8. asList(int[] values)
  9. asList(Iterable iterable)