title: Iterate through an ArrayList of ArrayLists in Java
body: <p>I have the following ArrayList...</p>
  
  <pre><code>ArrayList&lt;ArrayList&lt;Integer&gt;&gt; row1 = new ArrayList&lt;ArrayList&lt;Integer&gt;&gt;();
  </code></pre>
  
  <p>The following arraylists are added to it....</p>
  
  <pre><code>row1.add(cell1);
  row1.add(cell2);
  row1.add(cell3);
  row1.add(cell4);
  row1.add(totalStockCell);
  </code></pre>
  
  <p>I want to iterate through the arraylist row1 and print the contents.</p>
  
  <p>Would a loop within a loop work here?</p>
  
  <p>E.g.</p>
  
  <pre><code>while(it.hasNext()) {
  
  //loop on entire list of arraylists
      while(it2.hasNext) {
        //each cell print values in list
  
            } }
  </code></pre>