Example of program using multidimensional array in java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Example of program using multidimensional array in java

Java Multidimensional Array

9th Mar 2021, 2:37 PM
MS BLEA
5 Answers
+ 2
public class Program { public static void main(String[] args) { int[ ][ ] sample = { {1, 2, 3}, {4, 5, 6} }; int x = sample[1][0]; System.out.println(x); } } /* complete this lesson for explanation https://www.sololearn.com/learning/2149/ edit: hope it helps https://www.programiz.com/java-programming/multidimensional-array
9th Mar 2021, 7:58 PM
Jayakrishna 🇮🇳
+ 2
class MultidimensionalArray { public static void main(String[] args) { int[][] a = { {1, 2, 3}, {4, 5, 6, 9}, {7}, }; 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); } }
11th Mar 2021, 9:37 AM
R YUVARAJ
R YUVARAJ - avatar
+ 1
Thanks
9th Mar 2021, 11:02 PM
MS BLEA
+ 1
Thanks
11th Mar 2021, 9:47 AM
MS BLEA
0
You're welcome..
10th Mar 2021, 11:19 AM
Jayakrishna 🇮🇳