public static void main(String[] args) {
String [] aa = {"1","2","3","4","5"};
//向list批量注入值
List<String> list = Arrays.asList("1", "2", "3", "4", "5");
//数组转list
list = Arrays.asList(aa);
for (String string : list) {
System.out.println("list:"+string);
}
//打乱 list 集合元素的顺序(乱序)
Collections.shuffle(list);
for (String string : list) {
System.out.println("list2:"+string);
}
//list 转数组
int size = list.size();
String[] arr = (String[])list.toArray(new String[size]);
System.out.println(Arrays.toString(arr));
}
java的Arrays类的应用
http://blog.sina.com.cn/s/blog_93daad41010115yq.html
Apache下的ArrayUtils工具类总结 https://www.cnblogs.com/jxgo/p/7421307.html
Java List与数组之间的转换http://blog.csdn.net/kingzone_2008/article/details/8444678