Exception handlers are often used to recover from errors and clean up loose ends like open files. You can catch some exceptions and let others propagate. Believe it or not, you might want to throw your own exception. Exceptions are the easiest way to move program execution out of a method whose purpose has been defeated. For example, suppose you're writing a parser that reads Java code and analyzes its syntactic structure.
Parsers are quite complicated, and use many recursive calls and loops.
Suppose that your parser is executing a method many levels deep within the program stack within many levels of loop nesting. Suddenly, your code unexpectedly reaches the end of the file, because a student accidentally erased the last 50 lines of his program. It's quite painful to write code that elegantly retraces its way back up through the method calls and loops when a surprise happens deep within a parser. You can even roll your own. Now we can write some parser methods.