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

Explain when we should make an instance variable private.

606


What is a boolean structure?

554


Difference difference paint() and paintcomponent()?

530


How do I get a substring?

523


What is the benefit of using enum to declare a constant?

659






explain multi-threading in java?

548


How can u increase the heap size in the memory?

550


hi am an engineering student and my next plan is for ms in either in us or australia i got my passport but i dont know anything bout visa can u give brief idea 1)How to get prepared for visa and 2)How to apply for top universities and 3)How to pay the fee and so on These all are basic questions plz give me a clear idea

1458


Can we call thread start () twice?

512


I am a fresher and know core java, c languge, html, css etc if I am illegible for any job then send it on my email tatranakshay276@gmail.com

1072


Is char a method in java?

512


What is the intersection and union methods?

546


How do I enable java in safari?

545


What are java annotations?

643


What are invisible components?.

1677