Syntax for creating a two-dimensional array

前端 未结 12 1199
悲&欢浪女
悲&欢浪女 2020-11-21 18:11

Consider:

int[][] multD = new int[5][];
multD[0] = new int[10];

Is this how you create a two-dimensional array with 5 rows and 10 columns?<

12条回答
  •  情书的邮戳
    2020-11-21 18:48

    It is also possible to declare it the following way. It's not good design, but it works.

    int[] twoDimIntArray[] = new int[5][10];
    

提交回复
热议问题