废话不说,直接上代码
List转成数组
List<String> nameList = new ArrayList<>(); nameList .add("123'); nameList .add("123'); nameList .add("123'); //转成数组 String[] arr = nameList.toArray(new String[nameList.size()]);
数组转成List
String[] arr = new String[] {"1", "2"}; List list = Arrays.asList(arr);
时间: 2024-10-07 06:33:52