Check out example codes for "list to int array in java 8". It will help you in understanding the concepts better.
Code Example 1
List<Integer> al = new ArrayList<Integer>();
Integer[] arr = new Integer[al.size()];
arr = al.toArray(arr);
Code Example 2
int[] array = list.stream().mapToInt(i->i).toArray();
Learn ReactJs, React Native from akashmittal.com