<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">// Let's create [1 2; 3 4] in Java

public class aoa0  {
    public static void main(String args[]) {

        // create 2x2 array:

	   final int SIZE = 2;
	   int[][] a = new int[SIZE][SIZE];

        // create array $r0$ and store values:

	   int[] r0 = new int[2];
	   r0[0] = 1; r0[1] = 2;
        
        // create array $r1$ and store values:

	   int[] r1 = new int[2];
	   r1[0] = 3; r1[1] = 4;
        
        // store refs to arrays $r0$ and $r1$ as 
        // 1st and 2nd elements of array $a$:

           a[0] = r0;
           a[1] = r1;

        // Use $a[i][j]$ to access elements:

           for ( int i=0 ; i &lt; a.length ; i++) {        // "rows"
	       for ( int j = 0 ; j &lt; a[i].length ; j++) // "cols"
		   System.out.print(a[i][j] +" ") ;     // element
	       System.out.println();                    // skip line between rows
           }

    } // method main

} // class aoa0

/* Output

1 2 
3 4
*/
</pre></body></html>