T[]要列出的数组<;T>
/* 来自 N o w J a v a . c o m*/ //package com.nowjava; import java.util.ArrayList; import java.util.List; public class Main { public static <T> List<T> toList(T[] elems) { ArrayList<T> list = new ArrayList<>(); for (T elem : elems) { list.add(elem); } return list; } }