Some problems are naturally defined in terms of a smaller copy of themselves, like factorial, Fibonacci or walking a tree. Recursion lets a method call itself on that smaller input until it reaches a base case. Reach for it when the problem splits into similar subproblems, as in trees, backtracking and divide and conquer. For a simple count or sum a loop is usually clearer, and very deep recursion can throw StackOverflowError.