what are Checked & Unchecked exceptions ?

Answer Posted / aparna

Checked exceptions should be taken care by the user using
try and catch blocks otherwise runtime error occurs
for eg:
class.forName() method throws ClassNotFoundException which
should be caught between try and catch blocks

Unchecked exceptions are taken care by the jvm itself, user
need not worry about these type of exceptions
for eg:
Integer.parseInt() method throws NullPointerException which
need not be placed between try and catch blocks

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are keywords and reserved words in java?

672


What is jrmp?

626


Can we have two main methods in a java class?

627


Does java trim remove newline?

627


What does indexof return in java?

636






How do you sort a set in java?

614


What is string builder in java?

647


What is the purpose of garbage collection in java? When is it used?

656


What is the difference between static class and normal class?

598


What classes of exceptions may be thrown by a throw statement?

631


What is the difference between the jdk 1.02 event model and the event-delegation model introduced with jdk 1.1?

720


Can we print null in java?

683


Can we override constructors in java?

758


What is use of static method?

627


What is a superclass?

1016