title: Java - Array of Coordinates
body: <p>I need to write an single array of coordinates. I have written the Coordinate class such that:</p>
  
  <pre><code>public class Coordinate {
     int row;
     int column;
  
     public Coordinate (int column, int row) {
     ...
     }
  }
  </code></pre>
  
  <p>In my main method, I want to have an array <code>Coordinate positions[] = new Coordinate[64]</code> and populate it with values (0,0), (0,1), ..., (7,6), (7,7).</p>
  
  <p>Any idea on how to approach this? I have tried nested loops but I can't get it right.</p>
  
  <p>EDIT: sorry guys, still trying to figure things out with Stack Overflow
  I am doing:</p>
  
  <pre><code>  for(int i=0; i&lt;64; i++) {
          for(int c=0; c&lt;8; c++) {
              for(int r=0; r&lt;8; r++) {
              positions[i] = new Coordinate(c, r);
              }
          }
        }
  </code></pre>
  
  <p>But its making a mess and looping way too much</p>