Is there a way to create a two-dimensional array in java where 2nd dimension of the array has a variable number of elements?
For instance, if I knew the elements beforehand, I could declare the entire array at once like this.
int[][] runs = {{1, 4, 7}, {2, 3}, {1}};
However, I do not know the values beforehand. I would like to partially declare the array to do something like this:
int[][] runs = new int[3];
And then fill in each element of the 1st dimension with a an array of integers. But I get an error.