Which comes first in a 2D array, rows or columns?

前端 未结 9 733
小鲜肉
小鲜肉 2020-12-07 12:53

When creating a 2D array, how does one remember whether rows or columns are specified first?

9条回答
  •  一个人的身影
    2020-12-07 13:37

    While Matt B's may be true in one sense, it may help to think of Java multidimensional array without thinking about geometeric matrices at all. Java multi-dim arrays are simply arrays of arrays, and each element of the first-"dimension" can be of different size from the other elements, or in fact can actually store a null "sub"-array. See comments under this question

提交回复
热议问题