Solved

Why Is the Following Method One Which Has Infinite Recursion

Question 8

Multiple Choice

Why is the following method one which has infinite recursion? public int infiniteRecursion(int n)
{
If (n > 0) return infiniteRecursion(n) + 1;
Else return 0;
}


A) because there is no base case
B) because the base case will never be true
C) because the recursive call does not move the parameter closer to the base case
D) because the recursive call moves the problem further away from the base case
E) None of these; this method isn't infinitely recursive

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions