CHAPTER 81 — More about Exceptions

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to home page   go to next page        

created: 04/30/00; revised: 09/13/00, 07/06/02, 06/07/03, 07/22/06

CHAPTER 81 — More about Exceptions

Java exceptions provide a powerful mechanism for writing robust, user-friendly code. This chapter continues the discussion started in the last chapter.

Chapter Topics:

  • Using the catch  parameter
  • IndexOutOfBoundsException
  • Checked and unchecked exceptions
  • The throws clause
  • The throw statement
  • Extending the Exception class

QUESTION 1:

Here is a catch{} block:

catch( Exception exp )
{
}

When the block catches an exception, what does exp refer to?