回答(1)
wustguangh 19级 2016-02-19 19:38:50
List转数组(Array):
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); }
数组(Array)转List:
String[] arr = new String[] {"1", "2"}; List list = Arrays.asList(arr);