 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
To
detect specific exceptions, we must specify when we
|
|
|
want
exception detection to be active.
|
|
| • |
Think
of this as "turning on" exception handling for a
|
|
|
particular
section of code (the try block).
|
|
| • |
A
try block is a compound statement preceded by the try
|
|
|
keyword.
|
|
| • |
Once
the thread of control enters a try block, exception
|
|
|
handling
is in effect until the try block is exited.
|
|
| • |
Think
of a try block as specifying when we want to detect
|
|
exceptions.
We can only detect an exception that is
|
|
|
thrown
when the thread of control is inside of a try block.
|
|