Java ArrayList Create newArrayList(E... elements)

Here you can find the source of newArrayList(E... elements)

Description

new Array List

License

Open Source License

Declaration

public static <E> List<E> newArrayList(E... elements) 

Method Source Code

//package com.java2s;

import java.util.ArrayList;

import java.util.Collections;

import java.util.List;

public class Main {

    public static <E> List<E> newArrayList(E... elements) {
        ArrayList<E> list = new ArrayList<E>(elements.length);
        Collections.addAll(list, elements);
        return list;
    }//  w w w.  j a  va2 s  .  co m
}

Related

  1. newArrayList()
  2. newArrayList()
  3. newArrayList(A... elements)
  4. newArrayList(Collection c)
  5. newArrayList(Collection collection)
  6. newArrayList(E... elements)
  7. newArrayList(final Collection elements)
  8. newArrayList(final Iterator iter)
  9. newArrayList(int initialCapacity)