A recursive function that never stops calls itself until Java throws a StackOverflowError. The base case is the input small enough to answer directly, and every recursive call must move closer to it. Think about it first when you write any recursive function, like stopping a digit sum when n < 10. Missing or wrong base cases, such as forgetting n == 0, are the most common recursion bug in tests.