ArrayList和数组间的相互转换
String s = "360001,光大量化核心,GDLHHX,1,1;360003,光大保德信货币,GDBDXHB,2,1;360008,光大增利收益A,GDZLSYA,1,1;360009,光大增利收益C,GDZLSYC,1,1";
String[] str = s.split(";");<br />
for (int i = 0; i < str.length; i++) {<br />
String ss = str[i];<br />
System.out.println(ss);<br />
}<br />
System.out.println("-------------------------------------------------");<br />
String[] abc = new String[] { "张三", "李四", "王五" };<br />
List<String> abcList = new ArrayList<String>(Arrays.asList(abc));<br />
abcList.retainAll(abcList);<br />
for (String string : abcList) {<br />
System.out.println(string.toString());<br />
}<br />
System.out.println("-------------------------------------------------");<br />
List<String> lists = Arrays.asList("张三", "李四", "王五");<br />
for (int i = 0; i < lists.size(); i++) {<br />
System.out.println(lists.get(i));<br />
}<br />
System.out.println("-------------------------------------------------");<br />
List<String> list=new ArrayList<String>(); <br />
list.add("王五"); <br />
list.add("张三"); <br />
list.add("李四"); <br />
int size = list.size();<br />
String[] array = list.toArray(new String[size]);<br />
for (int i = 0; i < array.length; i++) {<br />
System.out.println(array[i]);<br />
}