Java Array to List fromArray(T[] objects)

Here you can find the source of fromArray(T[] objects)

Description

from Array

License

Open Source License

Declaration

public static <T> ArrayList<T> fromArray(T[] objects) 

Method Source Code


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

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

public class Main {
    public static <T> ArrayList<T> fromArray(T[] objects) {
        ArrayList<T> arrayList = new ArrayList<T>();

        Collections.addAll(arrayList, objects);

        return arrayList;
    }/*from w ww .j  a v  a2  s  .  com*/
}

Related

  1. fromArray(Object array[])
  2. fromArray(Object[] array)
  3. fromArray(T array[])
  4. fromArray(T... array)
  5. fromArray(T[] array, Class clazz)
  6. newList(final T... elements)
  7. newList(final T... elements)
  8. newList(int... sizes)
  9. newList(T... elements)