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 is a constructor, constructor overloading in java?
Compare Mutex and Semaphore in java.
Can a final variable be manipulated in java?
What are data types in oop?
How to make a class or a bean serializable?
What is the relationship between class and object?
Give some features of interface?
Explain about class in java?
Explain about anonymous inner classes in java?
How do you create a first line indent?
What is a buffer in java?
What is array length?
What is a native method in java programming?
What are the advantages of defining packages in java?
Explain the access modifiers for a class, method and variables?