Recursion
A technique in which a method calls itself with a smaller version of the problem.
What is Recursion in Java?
Recursion — A technique in which a method calls itself with a smaller version of the problem.
class Countdown {
int count(int number) {
if (number == 0) {
return 0;
}
return 1 + count(number - 1);
}
}
Level: Apprentice · More Java terms at this level
Updated