I need to print this double array, but I continue to get an error in the last line with an “index”, and it says “cannot convert double to int”.
double[] i1 = new double[] {0.15, 0.875, 0.375};
Arrays.sort(i1);
System.out.print("1st array : ");
for(double index=0; index < i1.length ; index++)
System.out.print(" " + i1[index]);
source
share