title: Getting Arraylist IndexOutOfBoundsException
body: <p>Consider this code:</p>
  
  <pre><code>for(int i=0;i &lt;n;i++)
  {
      idx=transactions.get(row).size();
      c.add(transactions.get(row).get(idx));
  }
  </code></pre>
  
  <p>This is my code. I am getting <code>IndexOutOfBoundsException</code>  </p>
  
  <p>for the line  <code>c.add(transactions.get(row).get(idx))</code>. What is the problem?</p>