import java.util.List;import java.util.ArrayList;public class listToArr { public static void main(String[] args) { Listlist = new ArrayList (); list.add( 11 ); list.add( 23 ); list.add( 68 ); System.out.println( "list=" + list.toString() ); int count = 0; Integer intArr[] = new Integer[list.size()]; for( int i = 0; i < list.size(); i++ ) { intArr[count] = list.get(i); count++; } for( int i = 0; i < intArr.length; i++ ) { System.out.print( "intArr[" + i + "]=" + intArr[i] + " " ); } }}
运行结果为: