public class MDarrays_28 {
public static void main(String[] args) {
int flats[][];
flats = new int[2][3];
flats[0][0] = 101;
flats[0][1] = 102;
flats[0][2] = 103;
flats[1][0] = 201;
flats[1][1] = 202;
flats[1][2] = 203;
for (int i = 0; i < flats.length; i++) {
for (int j = 0; i < flats[i].length; j++) {
System.out.print(flats[i][j]);
System.out.print(" ");
}
System.out.println("\n");
}
}
}
the output:
101 102 103 0 Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 4 out of bounds for length 4
at MDarrays_28.main(MDarrays_28.java:15)
im very new to computer programming so any help would be really appreciated, thanks a ton!