Android Array to List Convert asList(T... args)

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

Description

as List

Declaration

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

Method Source Code

//package com.java2s;
import java.util.ArrayList;
import java.util.List;

public class Main {
    public static <T> List<T> asList(T... args) {
        ArrayList<T> rv = new ArrayList<T>();

        for (T a : args) {
            rv.add(a);//www.j av  a 2s.c  om
        }

        return rv;
    }
}

Related

  1. arrayToList(T[] array)
  2. asList(T... vals)
  3. asList(char[] array)
  4. asList(int[] array)
  5. asList(int[] intArray)