Articles
java
Convert list to array in Javajava

This is how you convert a list to an array in Java

Convert list to array

List<Integer> list = Collections.emptyList();
Integer[] array = new Integer[list.size()];
list.toArray(array);