Skip to content

Commit 8a25f9e

Browse files
author
Yalun Qin
committed
Add 2d Array example to TestArray.java
1 parent babfc78 commit 8a25f9e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

TestArray.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,16 @@ public static void main (String[] args) {
4343
arr4[0] = -1;
4444
System.out.println("Converted List = " + convertedList);
4545

46+
//Test 2d Array:
47+
int[][] nums = new int[][]{
48+
{},
49+
{1},
50+
{1, 3, 5, 7},
51+
{9, 8, 3, 11, -55},
52+
{4, 4, 8, 12, 55, 3, 8, -3, 4}
53+
};
54+
for (int[] array : nums) {
55+
System.out.println("Original array: " + Arrays.toString(array));
56+
}
4657
}
4758
}

0 commit comments

Comments
 (0)