How do I make a list into an array?

Java program to convert a list to an array

  1. Create a List object.
  2. Add elements to it.
  3. Create an empty array with size of the created ArrayList.
  4. Convert the list to an array using the toArray() method, bypassing the above-created array as an argument to it.
  5. Print the contents of the array.

For More Information Please Refer:
https://www.tutorialspoint.com/Java-program-to-convert-a-list-to-an-array
You May Also Like to Read: