Java ArrayList Create newArrayList()

Here you can find the source of newArrayList()

Description

new Array List

License

Apache License

Declaration

public static <T> ArrayList<T> newArrayList() 

Method Source Code

//package com.java2s;
/**//from  ww w .ja v a 2  s  . c  o  m
 * Bean Validation TCK
 *
 * License: Apache License, Version 2.0
 * See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
 */

import java.util.ArrayList;

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

    public static <T> ArrayList<T> newArrayList(int size) {
        return new ArrayList<T>(size);
    }

    @SafeVarargs
    public static <T> ArrayList<T> newArrayList(Iterable<T>... iterables) {
        ArrayList<T> resultList = newArrayList();
        for (Iterable<T> oneIterable : iterables) {
            for (T oneElement : oneIterable) {
                resultList.add(oneElement);
            }
        }
        return resultList;
    }
}

Related

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