Java ArrayList Create newArrayList(int size)

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

Description

Create new ArrayList .

License

Apache License

Parameter

Parameter Description
L type
size size

Declaration

public static <L> List<L> newArrayList(int size) 

Method Source Code


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

import java.util.ArrayList;

import java.util.List;

public class Main {
    /**//from  w ww . ja  v a2s. c om
     * Create new {@link ArrayList}.
     *
     * @param <L>  type
     * @param size size
     * @return {@link ArrayList}
     */
    public static <L> List<L> newArrayList(int size) {
        return new ArrayList<L>(size);
    }

    /**
     * Create new {@link ArrayList}.
     *
     * @param <L> type
     * @return {@link ArrayList}
     */
    public static <L> List<L> newArrayList() {
        return new ArrayList<L>();
    }
}

Related

  1. newArrayList(final Iterator iter)
  2. newArrayList(int initialCapacity)
  3. newArrayList(int initialCapacity)
  4. newArrayList(int initialCapacity)
  5. newArrayList(int initialCapacity)
  6. newArrayList(Iterable elements)
  7. newArrayList(Iterable iterable)
  8. newArrayList(T anObj)
  9. newArrayList(T... elements)