top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What are checked and unchecked exceptions in Java?

+1 vote
419 views
What are checked and unchecked exceptions in Java?
posted Aug 18, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Exceptions which are inherited from the Exception class are checked exceptions. Programmer/Client code has to handle the checked exceptions thrown by the API, either with try-catch block or with throws clause. i.e. SQLException, IOException.

RuntimeException also extends from Exception. There is no requirement for the Programmer/client code to deal with them, and hence they are called unchecked exceptions. i.e. NullPointerException, DivideByZeroException.

answer Aug 18, 2014 by Salil Agrawal
...