Java: Multi-dimensional array vs. one-dimensional

后端 未结 4 733
粉色の甜心
粉色の甜心 2020-11-29 00:47

For example:

  • a) int [x][y][z]

    vs

  • b) int[x*y*z]

Initi

4条回答
  •  無奈伤痛
    2020-11-29 01:21

    Use first variant (3-dimensional) because it's easier for understanding and there are less chances to make some logical error (especially if you're using it for modeling 3-dimensional space)

提交回复
热议问题