Maximum number of dimensions in a Java array

前端 未结 3 2055
借酒劲吻你
借酒劲吻你 2020-12-01 16:00

Out of curiosity, how many dimensions of an array can you have in Java?

3条回答
  •  醉梦人生
    2020-12-01 16:45

    Strictly speaking about

     Maximum number of dimensions in a Java array
    

    is only one dimensional array is possible in java. because under the hood java treat multidimensional arrays as array of arrays.

    Proof of concept: http://www.willamette.edu/~gorr/classes/cs231/lectures/chapter9/arrays2d.htm

    that's why its possible to have ragged arrays in Java as well!

提交回复
热议问题