Java ArrayList Create newArrayList(T... items)

Here you can find the source of newArrayList(T... items)

Description

new Array List

License

Apache License

Declaration

public static <T> List<T> newArrayList(T... items) 

Method Source Code

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

import java.util.ArrayList;

import java.util.List;

public class Main {
    public static <T> List<T> newArrayList(T... items) {
        List<T> list = new ArrayList<T>();
        for (T t : items) {
            list.add(t);//from  w ww .java 2  s. c o  m
        }

        return list;
    }
}

Related

  1. newArrayList(int size)
  2. newArrayList(Iterable elements)
  3. newArrayList(Iterable iterable)
  4. newArrayList(T anObj)
  5. newArrayList(T... elements)
  6. newArrayList(T... objectList)
  7. newArrayList(T... objs)
  8. newArrayList(X... args)
  9. newArrayListOnNull(List list)