title: How to check the end of the array
body: <p>I have an array of type int</p>
  
  <p>matrix[][]</p>
  
  <p>and it has values of 0 and 1</p>
  
  <pre><code>000000000
  101010111
  000010100
  110011001
  </code></pre>
  
  <p>the values are different to the above, however this is a random example. </p>
  
  <p>What i need to do is, </p>
  
  <p>loop through the first row when column = 0 and row = 0 adding 1 to row to loop</p>
  
  <p>if a one is found add it to a variable</p>
  
  <p>when i get to the end of the row i need to then go down the colum 0 row = 0 adding 1 to column to get the loop</p>
  
  <p>then i need to check the sum variable i have been adding to is % 2 = 0</p>
  
  <p>then i need to check row 1 column 1 </p>
  
  <p>and repeat for all</p>
  
  <p>the problerm i am having is determining when i have got to the end of a row, how is this calculated?</p>
  
  <pre><code>    for(int row = 0; row &lt; matrix.length; row++){
          if(matrix[columns][row] == 1){
              sum ++;
              if(i am at the end of the row){
                  //continue with other steps here
  </code></pre>