Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java get size of matrix

//Get rows size matrix
matrix.length;
//Get columns size of matrix
matrix[0].length;
Comment

java length of matrix

public static void main(String[] args) {

    int[][] foo = new int[][] {
        new int[] { 1, 2, 3 },
        new int[] { 1, 2, 3, 4},
    };

    System.out.println(foo.length); //2
    System.out.println(foo[0].length); //3
    System.out.println(foo[1].length); //4
}
Comment

PREVIOUS NEXT
Code Example
Java :: all possible valid IP addresses leetcode 
Java :: printing 2d array in java 
Java :: running sum of 1d array 
Java :: java check if number is in range 
Java :: filter arraylist java 
Java :: pretty print json in console 
Java :: java copy file 
Java :: what does static mean java 
Java :: How to efficiently find the next greater permutation of a list of values, in Java? 
Java :: How to connect from Android emulator to application on localhost? 
Java :: Java print class type 
Java :: iterate through hashMap by forEach loop 
Java :: how to get child from layout in android 
Java :: spinner get selected index 
Java :: last char in string java 
Java :: viewpager androidx dependencies 
Java :: java first letter to upper case 
Java :: java create unmodifiable list 
Java :: java get first day of the week 
Java :: datatypes in java 
Java :: okhttp3 library in android studio 
Java :: test a javafx project 
Java :: java replace character 
Java :: java random int between 2 numbers 
Java :: set textview text android java 
Java :: variables java 
Java :: map initialization java 
Java :: java input string with spaces 
Java :: how to change tablayout current view position in android 
Java :: input long in java 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =