Two Dimensional Array Program In Java

[Solved] Two Dimensional Array Program In Java | Scala - Code Explorer | yomemimo.com
Question : Multidimensional Array in Java

Answered by : unsightly-unicorn-1cjun9udyrbh

class multiDimensionalArray
{ public static void main(String args[]) { int multiDimensional[][] = { {1,2,3},{4,5,6},{7,8,9} }; for (int i=0; i< 3 ; i++) { for (int j=0; j < 3 ; j++) System.out.print(multiDimensional[i][j] + " "); System.out.println(); } }
}

Source : https://softhunt.net/how-to-initialize-an-array-in-java-with-examples/ | Last Update : Tue, 04 Jan 22

Question : 2-dimensional Array java

Answered by : samer-saeid

class MultidimensionalArray { public static void main(String[] args) { // create a 2d array int[][] a = { {1, 2, 3}, {4, 5, 6, 9}, {7}, }; // calculate the length of each row System.out.println("Length of row 1: " + a[0].length); System.out.println("Length of row 2: " + a[1].length); System.out.println("Length of row 3: " + a[2].length); }
}

Source : | Last Update : Mon, 30 May 22

Question : multi dimensional array declaration in java

Answered by : evil-eland-i574a7bpmsiq

Syntax:
return_type [][]varible_name=new return_type[no_of_rows][no_of_columns];
int [][]a=new int[5][5];
Valid Declearation are following:
int [][]a=new int[5][5];
int []a[]=new int[5][5];
int [][]a[]=new int[5][5][5];

Source : | Last Update : Sat, 08 Jan 22

Answers related to two dimensional array program in java

Code Explorer Popular Question For Scala