title: Java add matrix antidiagonal elements
body: <p>I want to add a NxN matrix antidiagonal elements using a for loop in a java program.</p>
  
  <p>This code (2 conditions) does not work because it always says when the loop is executed sum2=0.</p>
  
  <pre><code>for (int i=0,j=t-1; i&lt;t &amp;&amp; j==0; i++, j--) { 
     sum2 = sum2 + aNumber[i][j];
  }  
  </code></pre>
  
  <p>Instead this one (one condition) works well.</p>
  
  <pre><code>for (int i=0, j=t-1; i&lt;t ; i++, j--) {
     sum2 = sum2 + aNumber[i][j];
  }  
  </code></pre>
  
  <p>Why does not work the first code?</p>