I used to think that when an exception happened, the whole java application will be terminated. For example, I write a test function to test my idea.
public void
There are two main types of exceptions:
It indicates the system is working properly. You must catch the exception or it won't compile. It will never terminate the application. If you want to terminate anyway, you have to call System.exit(ERROR_NUMBER) in the catch block or throw a runtime exception.
Indicates a system error (eg. application server misconfiguration). You don't have to catch it. If you don't catch it, it terminates the application or if you write a J2EE application the AS might handle it and continue your app.