Java ArrayList Create newArrayList()

Here you can find the source of newArrayList()

Description

Constructs an empty ArrayList.

License

Apache License

Declaration

public static final <E> ArrayList<E> newArrayList() 

Method Source Code

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

import java.util.ArrayList;
import java.util.Collections;

public class Main {
    /**/*from www.j  a va2 s  . c  o  m*/
     * Constructs an empty ArrayList.
     */
    public static final <E> ArrayList<E> newArrayList() {
        return new ArrayList<E>();
    }

    /**
     * Constructs an empty ArrayList.
     */
    public static final <E> ArrayList<E> newArrayList(
            @SuppressWarnings("unchecked") E... e) {
        ArrayList<E> list = new ArrayList<E>();
        Collections.addAll(list, e);
        return list;
    }
}

Related

  1. newArrayList()
  2. newArrayList()
  3. newArrayList()
  4. newArrayList()
  5. newArrayList()
  6. newArrayList()
  7. newArrayList()
  8. newArrayList()
  9. newArrayList(A... elements)