title: Java - arraylist of multidimensional arrays or arraylist of multidimensional arraylists?
body: <p>I'm learning Java and am trying to wrap my head around these data structures. I'm coming from Python/PHP so I'm used to dynamically sizing arrays on the fly and being able to store multiple data types in one array.</p>
  
  <p>How would I best store this data? Say I don't know how many rows I'll have, but I do know that each row will hold 2 columns of data. One column being a string, and the other column being a double. </p>
  
  <p>Example in pseudo-ish code if I had 3 rows:</p>
  
  <pre><code>array(array("description1", 10.00),
        array("description2", 12.00),
        array("description3", 14.00));
  </code></pre>
  
  <p>Then, I want to loop through the array to process the datawith something like:</p>
  
  <pre><code>foreach(rows as row){
      myStringVal = row[0]; //on first iteration would be "description1"
      myIntVal = row[1];    //on first iteration would be 10.00
      ... do something with the values ...
  }
  </code></pre>
  
  <p>I'm thinking I need to create an arraylist that holds an array, but I can't store both strings and doubles in a java array, so what do i do? Do I use a map instead, and treat it as if it were an array? For example, do I create a map where the first element is a numeric ID for each row, the second element is the string value, the 3rd element is the double value, and then I use a loop to increase a counter and grab each row from the map that using the numeric ID></p>
  
  <p>Really confused as to how this will work. Any suggestions? Thanks!</p>