1.将数组转换成List
String[] array = new String[] { "aa", "bb", "cc" };
List<String> list = Arrays.asList(array);
for (String string : list) {
System.out.println(string);
}
2.将List转换成数组
List<String> list2 = new ArrayList<String>();
list2.add("aa");
list2.add("bb");
list2.add("cc");
String[] resStrings = new String[list2.size()];
resStrings = (String[]) list2.toArray(resStrings);
for (String string : resStrings) {
System.out.println(string);
}