14. Recursion
Overview
In this chapter, we will see how using recursion can help you to write effective code. The chapter begins with an initial exercise illustrating one of the simplest mistakes you can make with recursion: forgetting to code a termination condition. The first step, then, is learning how to salvage your program when the Java stack has blown away. From there, you will learn to write recursive methods in order to handle mathematical formulas and other recurrent processing needs. Finally, with these techniques (and those further defined by this chapter), you will practice creating and processing XML files with the Document Object Model (DOM) API.