How can I store arrays in single array?
e.g. I have four different arrays, I want to store it in single array int storeAllArray []
and when I call e.g. storeAllArray[1] , I will get this output [11,65,4,3,2,9,7]
instead of single elements?
int array1 [] = {1,2,3,4,5,100,200,400};
int array2 [] = {2,6,5,7,2,5,10};
int array3 [] = {11,65,4,3,2,9,7};
int array4 [] = {111,33,22,55,77};
int storeAllArray [] = {array1,array2,array3,array2}
// I want store all array in on array
for (int i=0; i<storeAllArray; i++){
System.out.println(storeAllArray.get[0]); // e.g. will produce --> 1,2,3,4,5,100,200,400 , how can I do this?
}
EDITED: How can I get output like this?
System.out.println(storeAllArray [0]) --> [1,2,3,4,5,100,200,400];
System.out.println(storeAllArray [1]) --> [2,6,5,7,2,5,10];
System.out.println(storeAllArray [2]) --> [11,65,4,3,2,9,7];
System.out.println(storeAllArray [2]) --> [111,33,22,55,77];