java List转换和数组互转
1、List转Array
ArrayList<String> list=new ArrayList<String>(); String[] strings = new String[list.size()]; list.toArray(strings);
2、Array转List
String[] s = {"a","b","c"};
List list = java.util.Arrays.asList(s);
1、List转Array
ArrayList<String> list=new ArrayList<String>(); String[] strings = new String[list.size()]; list.toArray(strings);
2、Array转List
String[] s = {"a","b","c"};
List list = java.util.Arrays.asList(s);