title: how to add elements in a 2d array
body: <p>I just want to know how this program works, and why the answer is 14.
  here is the code:</p>
  
  <pre><code>public class extra {
  public static void main(String[] args){
      int[][] table = {{1,2,3},{4,5,6},{7,8,9}};
      int sum = 0;
      for( int i = 2; i &gt; 0; i-- ) 
                sum += table[i][3-i];
                System.out.println(sum);
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I understand the way the matrix is set up</p>
  
  <p>123</p>
  
  <p>456</p>
  
  <p>789</p>
  
  <p>but what is i in this problem, because I thought it was the number of rows, but since it is in a for loop, does it mean that i is the number in the matrix? Also how do the [i][3-i] come in to affect? The answer is 14, and I just want to know how it is 14.</p>