Getting the array length of a 2D array in Java

前端 未结 12 2301
耶瑟儿~
耶瑟儿~ 2020-11-27 09:27

I need to get the length of a 2D array for both the row and column. I’ve successfully done this, using the following code:

public class MyClass {

 public s         


        
12条回答
  •  渐次进展
    2020-11-27 10:04

    .length = number of rows / column length

    [0].length = number of columns / row length

提交回复
热议问题