Adding elements of arraylist into array | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Adding elements of arraylist into array

i have a huge amount of Strings generated after a system so the generation algorythm works fine. but i wanna save every single string in an arraylist first and after a specific amount i want to store the generated strings into an array and clear the arraylist so i can save another like 10 mil strings into the arraylist befor adding them to the array. and i tried the toArray method but ut overrides the existing entrys. if you have to know something else about this just ask.

19th Oct 2017, 1:22 PM
Niklas
Niklas - avatar
1 Answer
+ 2
Just make a method to merge two arrays! And then just keep adding the new one to the Array you want!
19th Oct 2017, 2:18 PM
Chriptus13
Chriptus13 - avatar