Java List from Array asList(T[] array)

Here you can find the source of asList(T[] array)

Description

as List

License

Open Source License

Declaration

public static <T> List<T> asList(T[] array) 

Method Source Code

//package com.java2s;
import java.util.List;
import java.util.Arrays;
import java.util.Collections;

public class Main {
    public static <T> List<T> asList(T[] array) {
        List<T> list;/*from  www  .  j  a  v a 2  s  . c  o m*/
        if (array != null) {
            list = Arrays.asList(array);
        } else {
            list = Collections.emptyList();
        }
        return list;
    }
}

Related

  1. asList(T... values)
  2. asList(T... values)
  3. asList(T[] a)
  4. asList(T[] array)
  5. asList(T[] array)
  6. asList(T[] array)
  7. asList(T[] array)
  8. asListFromObjectArray(Object[] at)
  9. convertArrayToList(int[] ids)