array.length returns the number of rows (4)
array[i].length returns the number of columns of row i (3)
So for this 2D array:
- array.length is 4
- array[0].length, array[1].length, array[2].length, array[3].length are all 3
The outer dimension represents rows, the inner dimension represents columns.
VTC Academy THSoft Co.,Ltd 22
Actions on Eclipse
Open Eclipse IDE
Create project: Session2Ex
Create java class: Ex2WithArrays.java
Write code to: