We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a12da0b commit fa2d7ebCopy full SHA for fa2d7eb
1 file changed
TestArray.java
@@ -63,6 +63,18 @@ public static void main (String[] args) {
63
System.out.println("");
64
}
65
66
+ //Can the length of second dimension be 0? Yes!
67
+ int[][] nums3 = new int[4][0];
68
+ //int[][] nums3 = new int[0][0]; //First dimension can also have 0 length
69
+ System.out.println("nums3: 4 x 0: ");
70
+ for (int i = 0; i < nums3.length; ++i) {
71
+ System.out.print("Row " + i + ": ");
72
+ for (int j = 0; j < nums3[i].length; ++j) {
73
+ System.out.print("(" + i + ", " + j + ")=" + nums3[i][j] + " ");
74
+ }
75
+ System.out.println("");
76
77
+
78
//Array of super types
79
Animal[] animals = new Animal[3];
80
for (int i = 0; i < animals.length; ++i) {
0 commit comments