java List轉換和數組互轉

一、List轉Arrayjava

ArrayList<String> list=new ArrayList<String>();
String[] strings = new String[list.size()];
list.toArray(strings);

二、Array轉Listspa

String[] s = {"a","b","c"};
List list = java.util.Arrays.asList(s);
相關文章
相關標籤/搜索