Programming Blog

This blog is about technical and programming questions and there solutions. I also cover programs that were asked in various interviews, it will help you to crack the coding round of various interviews

Tuesday, 12 December 2017

Exceptions in java

        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:
  1. Checked Exception
  2. Unchecked Exception
  3. Error


No comments:

Post a Comment