1、数组转成list
String[] names = new String[5];
Arrays.asList(names);
Arrays中的asList方法:
public static <T> List<T> asList(T... a) { return new ArrayList<>(a); }
2.list转成数组
List<string> list= new ArrayList();
string[] names= new string[list.size()];
list.toArray(names);
List中的toArray方法:
<T> T[] toArray(T[] a);