Java Array to List toList(T[] arr)

Here you can find the source of toList(T[] arr)

Description

to List

License

Open Source License

Declaration

public static <T> java.util.List<T> toList(T[] arr) 

Method Source Code

//package com.java2s;

public class Main {
    public static <T> java.util.List<T> toList(T[] arr) {
        java.util.List<T> rel = null;
        if (arr != null && arr.length > 0) {
            rel = new java.util.ArrayList<T>();
            for (T item : arr) {
                rel.add(item);/*from  w w  w  .  j a v  a 2 s.  c  o m*/
            }
        }
        return rel;
    }
}

Related

  1. toList(T... items)
  2. toList(T... objects)
  3. toList(T... objects)
  4. toList(T[] _array)
  5. toList(T[] anArrayToConvert)
  6. toList(T[] array)
  7. toList(T[] array)
  8. toList(T[] array)
  9. toList(T[] array)