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
Is char * a string?
What is difference between array and vector?
What is the purpose of void?
What is a parameter in simple terms?
What do you mean by exception handling in Java?
What is garbage collection? Can it be forced to run?
What is data string?
What do you understand by the term singleton?
What is the difference between Java1.4 and Java1.5
Is java se open source?
What is the purpose of a default constructor?
Is java developer a good career?
What are the advantages of defining packages in java?
Can we restart a thread already started in java?
What are user defined exceptions?