What is the difference between Checked and Unchecked
exception? Give some examples

Answer Posted / padmaja

1. Checked exceptions are exceptions that must be
declared in the throws clause of a method. A checked
exception indicates an expected problem that can occur
during normal system operation. Checked exceptions must be
2. Unchecked exceptions are exceptions that do not
need to be declared in a throws clause. An unchecked
exception indicates an unexpected problem that is probably
due to a bug in the code. The most common example is a
NullPointerException.They don't have to be caught or
declared thrown.
3. Checked exceptions in Java extend the
java.lang.Exception class. Unchecked exceptions extend the
java.lang.RuntimeException.

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are advantages of exception handling in java?

817


Why pointers are not used in java?

861


What is replacefirst in java?

797


What is a qualifier in a sentence?

781


Can we create our own wrapper class in java?

764


what is ststic with example

1820


What is lambda programming?

732


What is the format specifier?

733


What state is a thread in when it is executing?

745


What are the differences between include directive and include action?

794


placement papaers of spring computing technology

1216


How to use arraylist in java netbeans?

760


What are the rules for variable declaration?

723


Why parameters should be passed by reference?

734


What is the r character?

824