Recursive Factorial Method
What is the result of factorial(4) when using the above method?
public int factorial(int n) {
if (n <= 1) {
return 1;
}
return n * factorial(n - 1);
}
A
4
B
120
C
16
D
24
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE