title: How to create Dynamic Two Dimensional Array [JAVA]
body: <p>I am new to java and I want to create a 2-dimensional array in which the rows are static but the columns are dynamic. </p>
  
  <pre><code>double [][] lastSecArray = new double [2][41];
  int lastValue = -1;
  public foo (){
     lastValue++;
     lastSecArray[0][lastValue] = st_ms;
     //more code here
  }
  </code></pre>
  
  <p>The value of lastValue increases and when it reaches 41 my program gives me Array Index out of bound. Which is what I should expect.</p>
  
  <p>How can I make the column of teh array dynamic so that no matter how large the value of lastValue increases it runs.</p>