Skip to content

Commit f19e6ea

Browse files
Create Java-2D-Array.txt
1 parent b5ce94a commit f19e6ea

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎Day3/Java-2D-Array.txt‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class MyClass {
2+
public static void main(String[] args) {
3+
int[][] num = { {1, 2, 3, 4}, {5, 6, 7} };
4+
int x = num[1][2];
5+
System.out.println(x);
6+
//Loop Through an 2D Array
7+
for (int i = 0; i < num.length; ++i) {
8+
for(int j = 0; j < num[i].length; ++j) {
9+
System.out.println(myNumbers[i][j]);
10+
}
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)