title: Iterating through the subdiagonal of a 2D Array
body: <p>I am trying to iterate through a randomly generated 2d array of 0s, and 1s. In this method which I am stuck on I am trying to see if the subdiagonal has all the same numbers, all 1s, all 0s, or different numbers. </p>
  
  <p>sub diagonal meaning:</p>
  
  <p>110</p>
  
  <p>101</p>
  
  <p>011</p>
  
  <p>The 0s are the subdiagonal. </p>
  
  <p>this is the code I have as of now. I am trying to iterate starting at the last row and counting up to the first row diagonally.</p>
  
  <pre><code>int firstValue= matrix[matrix.length-1][0];
      int result = -1;
      for(int row = matrix.length-1; row &gt; 0; row--)
      {
          int column = row;
          if(firstValue == matrix[row][column])
          {
              result = firstValue;
              continue;
          }
          else
          {
              result = -1;
              break;
          }
      }
      if(result== 1)
      {
          System.out.println("All " + firstValue + "s on the subdiagonal");
      }
      else if (result == 0)
      {
          System.out.println("All " + firstValue + "s on the subdiagonal");
      }
      else
      {
          System.out.println("Numbers on subdiagonal are different");
      }
  }
  </code></pre>
  
  <p>I'm almost certain my issue is with the firstValue and/or the for loop counting up the diagonal. 
  Any help would be appreciated, thanks much </p>