Java List Create asList(T... array)

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

Description

as List

License

Apache License

Declaration

public static <T> List<T> asList(T... array) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {

    public static <T> List<T> asList(T... array) {
        if (array == null) {
            return null;
        }//  w w  w .j  a  va  2 s  .c  o  m

        List<T> list = new ArrayList<T>(array.length);
        for (T t : array) {
            list.add(t);
        }
        return list;
    }
}

Related

  1. asList(int[] array)
  2. asList(Iterable iteratable)
  3. asList(Object[] array)
  4. asList(Object[] array)
  5. asList(T... a)
  6. asList(T... elements)
  7. asList(T... items)
  8. asList(T... objs)
  9. asList(T[] array)