Recursive Factorial Method
Consider the following method.
public int factorial(int n) {
if (n <= 1) {
return 1;
}
return n * factorial(n - 1);
}
What value is returned by the call factorial(4)?
A
16
B
120
C
4
D
24
Question Leaderboard
Not enough data yet to show leaderboard.
