how to get the dimensions of a 2d array in java
Java
public class Main {
public static void main(String[] args) {
int[][] test = new int[10][4];
int rows = test.length;
int coloumns = test[0].length;
System.out.println(rows);
System.out.println(coloumns);
}
}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
}
Also in Java:
- Title
- osmdroid offline map does not show
- Category
- Java
- Title
- how to get a user to add to an arraylist in java
- Category
- Java
- Title
- one line if statement java
- Category
- Java
- Title
- récupérer les données d un liste java
- Category
- Java
- Title
- sort array java
- Category
- Java
- Title
- goodbye java
- Category
- Java
- Title
- calculate days between two dates in java
- Category
- Java
- Title
- java generic calling clone method
- Category
- Java
- Title
- how do you concatenate an int with a string in java
- Category
- Java
- Title
- java nested for loop
- Category
- Java
- Title
- processing library cassette
- Category
- Java
- Title
- programa que convierete un archi de c a java
- Category
- Java
- Title
- how to take max value from priority queue in java
- Category
- Java
- Title
- iterate map in java
- Category
- Java
- Title
- nextchar in java
- Category
- Java
- Title
- java not instanceof
- Category
- Java
- Title
- create notification android
- Category
- Java
- Title
- how to limit double decimal places java
- Category
- Java
- Title
- java read each lines in file
- Category
- Java
- Title
- java array check duplicates
- Category
- Java
- Title
- print a string java
- Category
- Java
- Title
- java print treemap
- Category
- Java
- Title
- how to reverse a list in java
- Category
- Java
- Title
- reading string after double in java
- Category
- Java
- Title
- java how to serialize a file into a local server
- Category
- Java
- Title
- binary number input in int java
- Category
- Java
- Title
- jackson ignore values if empty
- Category
- Java
- Title
- spigot disable join message
- Category
- Java
- Title
- character at index of string java
- Category
- Java
- Title
- primitive and non primitive data types in java
- Category
- Java
- Title
- java observable to observer
- Category
- Java
- Title
- Spigot API inventory close
- Category
- Java
- Title
- how to crate a list in java script
- Category
- Java
- Title
- numberformatexception
- Category
- Java
- Title
- java windowbuilder full screen
- Category
- Java
- Title
- excel data formatter in java
- Category
- Java
- Title
- load contents of file into string java
- Category
- Java
- Title
- java run project from command line
- Category
- Java
- Title
- separateur JMenu swing java
- Category
- Java
- Title
- cosinus-1 java
- Category
- Java
- Title
- find a substring in a string java
- Category
- Java
- Title
- date format in java
- Category
- Java
- Title
- how to create a linked list in java
- Category
- Java
- Title
- java get html from url
- Category
- Java
- Title
- java program to find prime number between 1 and 100
- Category
- Java
- Title
- how to run java program in linux server
- Category
- Java
- Title
- for loop java
- Category
- Java
- Title
- how to parse a string into a number in java
- Category
- Java
- Title
- keep jframe on top
- Category
- Java
- Title
- java observable to observer stack overflow
- Category
- Java
- Title
- How to print in console java
- Category
- Java
- Title
- java remove double spaces
- Category
- Java
- Title
- print out value java
- Category
- Java
- Title
- android studio remove navigation bar
- Category
- Java
- Title
- java android development get element by id
- Category
- Java
- Title
- how to make int array java android
- Category
- Java
- Title
- how to print in java
- Category
- Java
- Title
- java put a char array into a string
- Category
- Java
- Title
- vector length java
- Category
- Java
- Title
- how to iterate hashset in java 8
- Category
- Java
- Title
- java 8 seconds to days
- Category
- Java
- Title
- java hahmap
- Category
- Java
- Title
- java question mark operator
- Category
- Java
- Title
- java script snippet for responsive
- Category
- Java
- Title
- how to initialize an array in java
- Category
- Java
- Title
- how to declare list of object in java as constant
- Category
- Java
- Title
- ternary operator java
- Category
- Java
- Title
- how to return the first character in an array from a method java
- Category
- Java
- Title
- compile java to jar in mac
- Category
- Java
- Title
- java switch case
- Category
- Java
- Title
- how to get the width and height of a string in java
- Category
- Java
- Title
- how to create a button in java
- Category
- Java
- Title
- java string to char array
- Category
- Java
- Title
- socket in java
- Category
- Java
- Title
- how to make a pre set list java
- Category
- Java
- Title
- array in java
- Category
- Java
- Title
- absolute value in java
- Category
- Java
- Title
- equls en java
- Category
- Java
- Title
- how to print to console in java
- Category
- Java
- Title
- file with line numbers inserted java
- Category
- Java
- Title
- write in file java
- Category
- Java
- Title
- random number in range java
- Category
- Java
- Title
- isnumber java
- Category
- Java
- Title
- java fx display simple rectangle
- Category
- Java
- Title
- java split string on two or more spaces except for words in quotes
- Category
- Java
- Title
- java try catch
- Category
- Java
- Title
- check if string is null or empty java
- Category
- Java
- Title
- java length of matrix
- Category
- Java
- Title
- insert element into arraylist java
- Category
- Java
- Title
- on click android studio not working
- Category
- Java
- Title
- elasticsearch api code call using highlevelrestclient
- Category
- Java
- Title
- java bucket sort
- Category
- Java
- Title
- java read string input
- Category
- Java
- Title
- 2 decimal places print format JAVA
- Category
- Java
- Title
- check java version cmd
- Category
- Java
- Title
- android create notification
- Category
- Java
- Title
- java how to compare strings
- Category
- Java
- Title
- java vector push_back
- Category
- Java
- Title
- android how to switch between activities
- Category
- Java
- Title
- how to compare string in java
- Category
- Java