 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
When
an exception is thrown, we can associate an operand
|
|
of
some type with the throw operator.
|
|
| • |
The
type of the operand determines the type of the
|
|
|
exception.
|
|
| • |
Control
is passed to a block of code (the catch block)
|
|
|
corresponding
to that type.
|
|
| • |
The
value of the operand (the exception) associated with
|
|
|
throw
is passed to the catch block (the exception handler)
|
|
|
as a
temporary.
|
|
throw
i; //under some condition throw an
exception
|
|
//with an integer argument
|
|
|
catch(int
x) { //catch integer exceptions
|
|
...
|
|
}
|
|