Article
home/blog/Loading

Convert list to array in Java

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);