Question: Is there any bug in the code? /** * Return the average of elements in the input array. * @param * @return array input array

 Is there any bug in the code? /** * Return the

Is there any bug in the code?

/** * Return the average of elements in the input array. * @param * @return array input array to calculate the average from. the average of all numbers in the array. */ public static double findAvg(int array[]) { // short circuit protects null access null && array.length if (array 0) { return 0; double sum = 0; // sum up numbers in the array and calculate the average for (int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!