Java Array to ArrayList arrayToArraylist(T[] array)

Here you can find the source of arrayToArraylist(T[] array)

Description

array To Arraylist

License

Open Source License

Declaration

public static <T> ArrayList<T> arrayToArraylist(T[] array) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;

public class Main {
    public static <T> ArrayList<T> arrayToArraylist(T[] array) {
        ArrayList<T> ret = new ArrayList<T>();

        for (T e : array) {
            ret.add(e);//from  w w  w  .java  2 s  . c om
        }

        return ret;
    }
}

Related

  1. arrayToArrayList(Object aobj[])
  2. arrayToArrayList(Object[] array)
  3. arrayToArrayList(Object[] myArray)
  4. arrayToArraylist(String[] array)
  5. arrayToArrayList(T[] array)
  6. asArrayList(Collection c)
  7. asArrayList(T... elements)
  8. asArrayList(T[] tArray)
  9. asArrayList(T[] values)