java multiple catch blocks

Rules of Exceptions in Multiple Catch Blocks

Generally, it is a good programming practice to write one problematic statement (that may throw an exception) in one try block. If the same one statement is prone to multiple problems, then it is required to write multiple catch blocks or by chance if the try block contains multiple problematic…

try catch finally Exception Handling Java

try catch finally – The finally Block We know earlier, there should be a successful handler in the catch block like ArithmeticException for division by zero and ArrayIndexOutOfBoundsException for wrong array index number etc. Placing a wrong handler is equivalent to not having a try-catch block at all. There may…