Consider a method defined with the header: public void doublefoo(double x). Which of the following method calls is legal?
a) doublefoo(0);
b) doublefoo(0.555);
c) doublefoo(0.1 + 0.2);
d) doublefoo(0.1, 0.2);
e) all of the above are legal except for d
Answer: e. Explanation: In the case of a, the value 0 (an int) is widened to a double. In the case of c, the addition is performed yielding 0.3 and then doublefoo is called. The parameter list in d is illegal since it contains two double parameters instead of 1.