首页 > 代码库 > Java中List转换为数组,数组转List

Java中List转换为数组,数组转List

ArrayList<String> list=new ArrayList<String>();

String[] strings = new String[list.size()];

list.toArray(strings);

 

String[] s = {"a","b","c"};
List list = java.util.Arrays.asList(s);

 

Java中List转换为数组,数组转List