Skip to content

Commit f5ea326

Browse files
committed
Example of Multi Dimensional Array
1 parent 6a1631c commit f5ea326

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package Arrays;
2+
3+
public class MultiDimensionArray {
4+
public static void main(String[] args) {
5+
/*
6+
1 2 3
7+
4 5 6
8+
7 8 9
9+
*/
10+
11+
//It's important to define the number of rows for a 2D Dimensional Array. It's Mandatory.
12+
int[][] multiDimentionalArray = new int[3][3];
13+
14+
int [] [] array2D = {
15+
{1,2,3},
16+
{4,5},
17+
{7,8,9}
18+
};
19+
}
20+
}

0 commit comments

Comments
 (0)