+ 2
Please Explain multi dimensional arrays
2 Antworten
+ 22
arrays that contain other arrays
[[a,b,c],[1,2,3]]
+ 1
A multidimensional array is an array of arrays:
A 2D array can be represented as a table / matrix with rows and columns:
arr[3][2] --> is an array of 3 rows and 2 columns which you can access each element by two indices starting from zero (arr[0][0] --> first element / arr[2][1] --> element in third row and second column)
3D and above can be represented as a 1D array which each cell contains an array, and each cell in the second array contains another array...etc. :D
http://2.bp.blogspot.com/-SXMbF3iVB2s/VDjpPwGSGUI/AAAAAAAACB0/u-0QSuneaaA/s1600/two-dimensional-array-in-java.png