Recursive Function in Java

Recursive Function in Java


Recursive Function In Java Notes

A function which calls itself is known as a recursive function. A recursive function has two cases:

  1. Recursive Case

    It is the actual problem that needs to be solved. Recursive case is where the logic is applied.

  2. Base Case

    The part of the problem whose solution is known to us is known as the base case or the stopping case. In other words, it is the part which is used to control the recursion.

The figure below explains recursion.