posted 18 years ago
Amalip,
The jvm follow the order of the exceptions in the code. And, since exceptions are polymorhpic, the catch blocks should be in the order of smallest to biggest or you might get a compilation error.
For example, the following code throws an IOException but the Exception catch block is before the IOException. Since Exception is a supertype of IOException, you would get a compilation error, "Unreachable catch block for IOException. It is already handled by the catch block for Exception."
I hope this helps.
Sumit
[ April 23, 2005: Message edited by: Sumit Sadana ]
SCJP 1.2, SCJP 1.4, SCJA, SCWCD 1.4<br /> <br />------------------------------<br />