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
How can I become a good programmer?
Can we create a constructor in abstract class?
What is getkey () in java?
What are the 5 types of research methods?
Why we override equals() method?
How to find the given number is a prime number or not by getting input from the user
What is static block?
Can we return null in java?
Explain the pointers in Java?
What is tcp and udp?
Are strings immutable in java?
what is meant wrapper classes?
How do you escape sequences in java?
What is passing parameters in java?
What is a singleton factory?