Preview:
//Write a Java method that takes in an array of doubles and returns the product of all the doubles in the array.

public static void main(String[] args) {
		
		double[] Array1 = {2.9, 2.5, 5.6};
		double myProduct = products(Array1);
		System.out.printf("Product of array1 = %.2f " , myProduct);
		System.out.println();
}
public static double products(double[]arr) {
		double product = arr[0] * arr[1] * arr[2];
		for(int i=1;i<arr.length;i++) {
		}
		return product;
	}

//output 
Product of array1 = 40.60 
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter