Java ArrayList Create newArrayList(int initialCapacity)

Here you can find the source of newArrayList(int initialCapacity)

Description

new Array List

License

Open Source License

Declaration

public static <E> ArrayList<E> newArrayList(int initialCapacity) 

Method Source Code


//package com.java2s;

import java.util.*;

public class Main {

    public static <E> ArrayList<E> newArrayList() {
        return new ArrayList<E>();
    }/*ww  w . jav a  2 s .  co m*/

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

    /**
     * new ArrayList(Collection)
     *
     * @param c
     * @param <E>
     * @return
     */
    public static <E> ArrayList<E> newArrayList(Collection<? extends E> c) {
        return new ArrayList<E>(c);
    }
}

Related

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