I'm new to Java (day 2), so please inform and forgive me if this doesn't make sense.
I have a two dimensional array, and I want to define a new array that consists of all of the first dimension for a specific location in the second dimension (example below). The only way I can think to do this is with a for loop, something like this:
double[][] twoDimArray = new double[5000][200];
// some code defining twoDimArray
double[] oneDimArray = new double[5000];
for (int i=0; i<5000; ++i) {
oneDimArray[i] = twoDimArray[i][199];
}
This works just fine, but is there a cleaner way to do this? Perhaps something like this:
double[] oneDimArray = twoDimArray[][199];
Thanks.