Multidimensional Arrays lengths in Java

后端 未结 8 1073
一个人的身影
一个人的身影 2020-12-04 18:15

How to find the lengths of a multidimensional array with non equal indices?

For example, I have int[][] pathList = new int[6][4]

Without actuall

8条回答
  •  無奈伤痛
    2020-12-04 19:05

    For 2 D array :-

    int x[][] = new int[6][12];
    System.out.println(x.length + " " + x[1].length);
    

    OUTPUT : 6 12

提交回复
热议问题