public static double product(double anArray[], int n) { // Precondition: 1 <= n <= max size of anArray. // Postcondition: Returns the product of the first n // items in anArray; anArray is unchanged. if (n == 1) { return anArray[0]; } else { return anArray[n-1] * product(anArray, n-1); } // end if } // end product