Check out example codes for "convert list to array in java". It will help you in understanding the concepts better.

Code Example 1

// Java program to convert a List to an array 
// using toArray() in a loop. 
import java.util.*; 
  
public class GeeksforGeeks { 
    public static void main(String[] args) 
    { 
        List<String> list = new LinkedList<String>(); 
        list.add("Geeks"); 
        list.add("for"); 
        list.add("Geeks"); 
        list.add("Practice"); 
  
        String[] arr = list.toArray(new String[0]); 
  
        for (String x : arr) 
            System.out.print(x + " "); 
    } 
}

Code Example 2

Integer[] arr = new Integer[al.size()]; 
arr = al.toArray(arr);

Learn ReactJs, React Native from akashmittal.com