May 2012
Intermediate to advanced
679 pages
16h 56m
English
Now, we are in a position to understand the working of exception handling mechanism with the knowledge of building blocks of exception handling. If we have some code which is likely to throw an exception, we have to place it in a try block. It should be followed by a catch clause. A pseudo code will look like as follows.
try { … throw this_exception ; … } catch (parameter) { //action statements } Next_Statement ;
The action can be described as follows. When try block is executing, it may encounter a throw statement. Please note the word may. In general1, throw statement is always a part of some conditional statement. Most of the times throw statement will not be executed. In that ...
Read now
Unlock full access