what are Checked & Unchecked exceptions ?

Answers were Sorted based on User's Feedback



what are Checked & Unchecked exceptions ?..

Answer / 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

what are Checked & Unchecked exceptions ?..

Answer / harmeet

Checked Exceptions must be caught and thrown by the user
otherwise compile time error will be displayed saying it
must be catched. We've to catch those exceptions using try
and catch blocks.
Eg:Class.forName() throws ClassNotFoundException, when
trying to load the specified file in class.forName().

whereas Unchecked Exceptions are handled by jvm, user need
not to handle those exceptions.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is CardLayout?

1 Answers   Infosys,


WHAT IS THE SCOPE FOR COREJAVA...? IS JAVA ONLY CORE JAVA ?

2 Answers  


What is the difference between length and size in java?

0 Answers  


What are the 2 types of java programs?

0 Answers  


How will you override default serialization mechanism in java

2 Answers  






How we can run a jar file through command prompt in java?

0 Answers  


What is difference between c++ and java ?

0 Answers  


What is double in java?

0 Answers  


What is the difference between an inner class and a sub-class?

0 Answers  


if the memory capacity is 700 presently occupied by process is 690. then another process request space(40) how this situation handled in java.

4 Answers   Wipro,


What is the default value of float and double datatype in java?

0 Answers  


Explain about doubly linked list

0 Answers   Aditi Placement Service,


Categories