Java Array to ArrayList toArrayList(T[] vals)

Here you can find the source of toArrayList(T[] vals)

Description

to Array List

License

Open Source License

Declaration

public static <T> List<T> toArrayList(T[] vals) 

Method Source Code


//package com.java2s;
import java.util.ArrayList;

import java.util.List;

public class Main {
    public static <T> List<T> toArrayList(T[] vals) {
        List<T> list = new ArrayList<T>();
        for (T val : vals) {
            list.add(val);
        }//from  w w  w  .  java  2  s.co m
        return list;
    }
}

Related

  1. toArrayList(List list)
  2. toArrayList(Object pObject)
  3. toArrayList(String str)
  4. toArrayList(String[] ss)
  5. toArrayList(T... items)
  6. toArrayListArr(ArrayList al)
  7. toByteArrayList(byte[] list)