title: 2d ArrayList in Java adding data
body: <p>I need little help on a homework assignment. I have to create a 10 by 10 <code>ArrayList</code>, not an array. This is what I have and I just need a hint on how to do a for loop to add the date to the 2D <code>ArrayList</code>. By the way this is for putting data that are grades; going from 100 to 82. (Yes I know it is homework but need to be pointed in the correct direction)</p>
  
  <pre><code>public void q6()
  {
    //part a
    ArrayList&lt;ArrayList&lt;Double&gt;&gt; grades;
    //part b
    grades = new ArrayList&lt;ArrayList&lt;Double&gt;&gt;(10);
    //second dimension
    grades.add(new ArrayList&lt;Double&gt;(10));
    for(int i = 0; i &lt; 10; i++)
    {
      for(int j = 0; j &lt; 10; j++)
      {
        // grades.get().add(); Not sure what to do here?
        // If this was an array I would do something like:
        // grades[i][j] = 100 -j -i;
      }
    }
  }
  </code></pre>