Exceptions in java
Exception handling is one of the most important feature of java programming that allows us to handle the runtime errors caused by exceptions. In this guide, we will learn what is an exception, and its types.
What is an exception?
An Exception is an unwanted event that interrupts the normal flow of the program. When an exception occurs program execution gets terminated. In such cases we get a system generated error message. The good thing about exceptions is that they can be handled in Java. By handling the exceptions we can provide a meaningful message to the user about the issue rather than a system generated message, which may not be understandable to a user.
What is exception handling?
Exception Handling is a mechanism to handle runtime errors such as ClassNotFound, IO,ArrayOutOfBound etc.
Type of exceptions
There are mainly two types of exceptions: checked and unchecked where error is considered as unchecked exception. The sun microsystem says there are three types of exceptions:
- Checked Exception
- Unchecked Exception
- Error
No comments:
Post a Comment