Recursion is a technique in which a method calls itself. A recursive method must contain a base case (exit condition) and a recursive step (calling itself with modified parameters).
Structure of a Recursive Method
Recursion is a technique in which a method calls itself. A recursive method must contain a base case (exit condition) and a recursive step (calling itself with modified parameters).