I am trying to do the following:
double[][] ret = new double[res.size()][columnSize];
for(int i = 0; i < res.size(); i++){
ret[i] = res.get(i).toArray(new double[columnSize]);
}
where res is declared as List<List<Double>>. The above does not work because toArray() method wants a parametrized array to infer resulting type and that cannot be primitive...
Now, I could just change return type of my method to Double[][] but later on I have other functions from different APIs that expect double[][] 9primitives). That means there would be a lot of Upcasting, doesn't it?
ANy solutions, advices?