
Multiple catch Statements 765
enters the number 0 or less than zero. If the user enters 0 in the first call, then the exception is
thrown, and the catch block is executed. The compiler ignores the next statement of the try
block. Once the control skips from the try block, it never comes back to execute the remaining
statements. Thus, in this program if in the first call the user enters 0, then the second call of the
function sqr() is not taken into account.
19.5 MULTIPLE catch STATEMENTS
We can also define multiple catch blocks; in the try block, such programs also contain multiple
throw statements based on certain conditions. The format of