数组转为集合
String[] nameList = new String["张三", "李四"];
List<String> list = Arrays.asList(nameList);
集合转为数组
List<String> list = new ArrayList<>();
list.add("张三");
list.add("李四");
String stringArray = new String[list.size()];
list.toArray(stringArray);