This example depicts the multi-catch feature added in JDK 7.
In this example we have added two such statements in our try block:
line 11-> it generates Arithmetic Exception (division by 0)
This example depicts the multi-catch feature added in JDK 7.
In this example we have added two such statements in our try block:
line 11-> it generates Arithmetic Exception (division by 0)
This example depicts how to create a custom exception type.We have created in class MyException which extends class Exception (line 2-15). In void main() we have added a catch block with a try block.
This example demonstrates that try statements can be implicitly nested via calls to methods.