May 2010
Intermediate to advanced
1272 pages
61h 18m
English
You do not always need to specify a variable in the Catch block. This can be the case in which you want to take the same action independently from the exception that occurred. For example, consider the following code:

The ex variable is not being used and no specific exceptions are handled. So the preceding code can be rewritten as follows, without the ex variable:

Whichever exception occurs, the code shows the specified message. This also works with regard to the re-throw technique. The following code simply ...
Read now
Unlock full access