title: Printing diagonal elements of a 2D array
body: <p>l'm trying to print the diagonal numbers of  a square 2D array but l'm having a hard time with it.It's because of how l create the array isn't it? What l am doing wrong? </p>
  
  <pre><code>int[][] arr1 = { { 1, 2,6}, { 3, 4,5} }; // l'm stuck here
  
      for (int i = 0; i &lt; arr1.length; i++) { 
          for (int j = 0; j &lt;arr1.length; j++) { 
              System.out.print(arr1[i][j] + " "); 
          } 
  
          System.out.println(); 
      }
       for (int k = 0; k &lt; arr1.length; k++) {
           System.out.println( arr1[k][k]);
       }
  </code></pre>
  
  <p>l expected to see 1    2    3<br>
                    4    5    6
                    7    8    9
  And for the actual results? l have being stuck</p>