Can someone please explain to me what I am doing wrong on the code below? I will appreciate it! I am getting the error "incompatible types: double cannot be converted into double[].
public class AverageFunction {
public static double mean(double[] a) {
double sum = 0.0;
for (int i = 0; i < a.length; i++)
sum += a[i];
return sum / a.length;
}
public static void main(String[] args) {
double[] a = StdIn.readDouble();
double result = mean(a);
StdOut.println(result);
}
}