Java ArrayList Create newArrayList()

Here you can find the source of newArrayList()

Description

new Array List

License

Open Source License

Declaration

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

Method Source Code


//package com.java2s;
/* Copyright c 2005-2012.
 * Licensed under GNU  LESSER General Public License, Version 3.
 * http://www.gnu.org/licenses/*www.  jav a 2 s . co  m*/
 */

import java.util.ArrayList;
import java.util.Collection;

import java.util.List;

public class Main {
    public static <E> List<E> newArrayList() {
        return new ArrayList<E>();
    }

    public static <E> List<E> newArrayList(int initialCapacity) {
        return new ArrayList<E>(initialCapacity);
    }

    public static <E> List<E> newArrayList(Collection<? extends E> c) {
        return new ArrayList<E>(c);
    }

    public static <E> List<E> newArrayList(E... values) {
        List<E> list = new ArrayList<E>(values.length);
        for (E e : values) {
            list.add(e);
        }
        return list;
    }
}

Related

  1. getArrayListFromInt(int number)
  2. getArrayListFromString(String wordSequence, String separator)
  3. newArrayList()
  4. newArrayList()
  5. newArrayList()
  6. newArrayList()
  7. newArrayList()
  8. newArrayList()
  9. newArrayList()