引入自: http://blog.csdn.net/aaronuu/article/details/7055650 List 轉換為 String數組 List<String> list = new ArrayList<String>(); list.add("a1"); list.add("a2"
引入自: http://blog.csdn.net/aaronuu/article/details/7055650
List 轉換為 String數組
List<String> list = new ArrayList<String>();
list.add("a1");
list.add("a2");
String[] toBeStored = list.toArray(new String[list.size()]);
for(String s : toBeStored) {
System.out.println(s);
}
String 數組轉換為 List
String[] arr = new String[] {"1", "2"};
List list = Arrays.asList(arr);