[java]
public class MainLTM {
public static void main(String args[]) {
int[][] a = new int[3][3]; // declaration of an array. here array a
// contain 3-rows and 3-columns.
a[0][0] = 1; // here initializing 1st element of an array
a[0][1] = 0;
a[0][2] = 0;
a[1][0] = 5;
a[1][1] = 1;
a[1][2] = 0;
a[2][0] = 9;
a[2][1] = 6;
a[2][2] = 3;
for (int i = 0; i < a.length; i++) // Here a.length is 3 ie i<3. { for (int j = 0; j < a[i].length; j++) // here a[i].length=3 ie. j<3. { System.out.print(a[i][j] + " "); // here printing an array // elements. } System.out.print("\n"); } } } [/java]
Output
1 0 0
5 1 0
9 6 3