0
Is there an example of a array nested in an array?
I’d figured the format would be like a nested for loop. I just wondered what it would look like cause of the java multidimensional array lesson. It said arrays can be nested in arrays.
2 ответов
+ 1
multidimensional arrays are one of the forms of nested arrays.
For eg:
int are [ ] [ ]= new Int [ ] [ ]{{3,4},{5,6},{6,2}}
this is a 3*2 matrix array eg
Here 3 makes 3 reference variables pointing to 3 arrays of sizes 2. {3,4}
{5,6}
{6,2}
this thing is called nesting of arrays !
0
Here is an array that contains two arrays :
[ [1, 2, 3] , [4, 5, 6] ]