for (int i = 0; i < doubles.length; i++)
for (int i = 0; i < doubles.length; i++) {
  public static double sum(double[] doubles) {    double sum = 0;    for (int i = 0; i < doubles.length; i++)      sum += doubles[i];    return sum;  }