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
What are advantages of exception handling in java?
Why pointers are not used in java?
What is replacefirst in java?
What is a qualifier in a sentence?
Can we create our own wrapper class in java?
what is ststic with example
What is lambda programming?
What is the format specifier?
What state is a thread in when it is executing?
What are the differences between include directive and include action?
placement papaers of spring computing technology
How to use arraylist in java netbeans?
What are the rules for variable declaration?
Why parameters should be passed by reference?
What is the r character?