List list = new ArrayList(); list.add("a"); list.add("b"); final int size = list.size(); String[] str = (String[])list.toArray(new String[size]); for (int i = 0; i < str.length; i++) { System.out.println(str[i]); }
时间: 2024-11-05 21:28:22
List list = new ArrayList(); list.add("a"); list.add("b"); final int size = list.size(); String[] str = (String[])list.toArray(new String[size]); for (int i = 0; i < str.length; i++) { System.out.println(str[i]); }