Java catch multiple exceptions
If you have to perform different tasks at the occurrence of different Exceptions, use java multi catch block.
Let's see a simple example of java multi-catch block.
Rule: At a time only one Exception is occured and at a time only one catch block is executed.
Rule: All catch blocks must be ordered from most specific to most general i.e. catch for ArithmeticException must come before catch for Exception .