Java Story

[ JAVA ] list to array , array to list

WhiteDuck 2016. 2. 2. 09:17
Integer[] spam = new Integer[] { 1, 2, 3 };
Arrays.asList(spam);

http://stackoverflow.com/questions/2607289/converting-array-to-list-in-java


Foo[] array = new Foo[list.size()];
list.toArray(array); // fill the array

http://stackoverflow.com/questions/9572795/convert-list-to-array-in-java

반응형