What is output by the following Java program?
1 2 3 4 5 6 7 |
|
Select one: a. 1 b. 42 c. 2 d. 0 e. 43
The inner call to "compute" has an argument, so it us es the second method definition, which returns 0+1, or 1. This 1 becomes the argument to the outer ca ll, which then returns 1+1, or 2. The first definition of "compute" is never used. The correct answer is: 2