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.
double [][] lastSecArray = new double [2][41];
int lastValue = -1;
public foo (){
lastValue++;
lastSecArray[0][lastValue] = st_ms;
//more code here
}
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.
How can I make the column of teh array dynamic so that no matter how large the value of lastValue increases it runs.