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