title: Java ArrayList with 2 columns
body: <p>I need to use an array list as I don't know how many rows I will need but I know I'll need 2 columns. I'm unsure of how to create such an array list, add to both columns and read data from both columns. Both columns will contain integers.</p>
  
  <p>I have seen some suggest:</p>
  
  <pre><code>ArrayList&lt;Arraylist&lt;Integer&gt;&gt; name = new ArrayList&lt;ArrayList&lt;Integer&gt;&gt;();
  </code></pre>
  
  <p>but I can find an explanation of how to add to both columns.</p>
  
  <p>I've also seen:</p>
  
  <pre><code>ArrayList&lt;Integer[][]&gt; name = new ArrayList&lt;Integer[][]&gt;();
  </code></pre>
  
  <p>and different variations of where and the number of square brackets.
  Thanks.</p>