I'm trying to define an array for 3 ArrayLists, each containing a double array. I've used the following syntax:
ArrayList<double[]> testSamples[] = new ArrayList[] {
new ArrayList<double[]>(), new ArrayList<double[]>(), new ArrayList<double[]>()
};
However this generates a "warning: [unchecked] unchecked conversion" warning when I compile the code. Note: the code works fine, I'm just tried to fix my syntax (correctly) to resolve the warning. Since the code works, it appears to be supported by Java, I'm baffled as to why I can't write something like (which generates a compile error):
ArrayList<double[]> testSamples[] = new ArrayList<double[]>[] {
new ArrayList<double[]>(), new ArrayList<double[]>(), new ArrayList<double[]>()
};
What am I doing wrong?