将List集合转换成String的数组的方法如下:
输入代码:
[java] view plain copy
List
list.add("a1");
list.add("a2");
String[] toBeStored = list.toArray(new String[list.size()]);
for(String s : toBeStored) {
System.out.println(s);
}
将List集合转换成String的数组的方法如下:
输入代码:
[java] view plain copy
List
list.add("a1");
list.add("a2");
String[] toBeStored = list.toArray(new String[list.size()]);
for(String s : toBeStored) {
System.out.println(s);
}