About Question enthuware.ocpjp.v21.2.4033 :
Posted: Sun Mar 09, 2025 7:01 am
The given answer in the first option states that the output will be "10.0 10 10", but the correct output is "10.0 10 10.0".
This discrepancy occurs because the variable e is a double, not an int. Specifically, e is assigned the result of mean(d, d), which calls the method:
Since d = 10, the method computes:
This discrepancy occurs because the variable e is a double, not an int. Specifically, e is assigned the result of mean(d, d), which calls the method:
Code: Select all
double mean(int i, int j) {
return Math.sqrt(i * j);
}
Code: Select all
Math.sqrt(10 * 10) = 10.0; // Returns a double