Java ArrayList toArray()
ArrayList: [Java, Python, C] Array: Java, Python, C, In the above example, we have created an arraylist named languages. Notice the line, languages.toArray(arr); Here, we have passed an array of String type as an argument. Hence, all elements of the arraylist are stored in the array.