Lesson 17 of 34
2D Arrays: Matrices
10 min 30 XP
A 2D array is a table with rows and columns, accessed as m[row][col]. m.length is the number of rows and m[0].length the number of columns.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.Transpose: put m[r][c] into t[c][r]. A popular matrix interview question.