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."