I am wondering if there is a way to create arrays in java based on a variable sum. Therefore, if I need to create 10 arrays, the loop will be 10 (they are all called sequentially). But if I didn’t need 10 arrays, the loop would create a lot as needed.
I imagine something like this:
for(i=0 up to i=imax)
create arrayi
where i am the variable in the for loop.
If imax is set to 3, it will produce: array0, array1, array2, array3
thank.
source
share