1.list转化为数组
ArrayList<String> list=new ArrayList<String>();
String[] strings = new String[list.size()];
list.toArray(strings);
2.数组抓化为list
String[] s = {"a","b","c"};
List list = java.util.Arrays.asList(s);
1.list转化为数组
ArrayList<String> list=new ArrayList<String>();
String[] strings = new String[list.size()];
list.toArray(strings);
2.数组抓化为list
String[] s = {"a","b","c"};
List list = java.util.Arrays.asList(s);
作者:guanbin —— 纵码万里千山
出处:https://www.cnblogs.com/guanbin-529/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。