Java List from Array arrayToList(T[] array)

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

Description

array To List

License

Apache License

Declaration

public static <T> List<T> arrayToList(T[] array) 

Method Source Code


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

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static <T> List<T> arrayToList(T[] array) {
        List<T> list = new ArrayList<T>();
        if (array == null || array.length == 0) {
            return list;
        }/*from   w  w w  .  j a  v  a  2 s.c o  m*/
        for (T t : array) {
            list.add(t);
        }
        return list;
    }
}

Related

  1. arrayToList(String[] array, String... defaults)
  2. arrayToList(String[] arrValues)
  3. ArrayToList(String[] input)
  4. arrayToList(String[] str)
  5. arrayToList(T array[])
  6. arrayToList(T[] array)
  7. arrayToList(T[] array)
  8. arrayToList(T[] array)
  9. arrayToList(T[] array)