叔叔不说 不解释 不约,直接上代码
package cn.kge.one; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Demo1 { public static void main(String[] args) { List<String> list = new ArrayList<String>(); list.add("a"); list.add("b"); list.add("c"); list.add("d"); list.add("e"); String[] strArray = list.toArray(new String[list.size()]); for(String str:strArray){ System.out.println(str); } System.out.println("-------------------优美的分割线------------------"); String[] strings = {"1","2","3","4"}; List<String> content = Arrays.asList(strings); for(String str:content){ System.out.println(str); } } }