It is essential to catch all types of exceptions

Showing Answers 1 - 17 of 17 Answers

Suganthi

  • Jun 13th, 2006
 

It is essential to catch/declare throws clause for checked exceptions. Unchecked exceptions need not be handled.

  Was this answer useful?  Yes

alpana

  • Jun 18th, 2006
 

what are checked n unchecked exceptions?

  Was this answer useful?  Yes

Guest

  • Jun 28th, 2006
 

See there are two types of exceptions...

1.Checked Exceptions-Some methods throw exceptions in their definition,so compiler checks it at compile time.Such as ClassNotFoundException,NOSuchMethodException.

2.UncheckedException-Compiler does not check for these exception and it is the job of run time environment to find the exception and create an object and throw it i.e. it is handled by default handler.

  Was this answer useful?  Yes

vijay bhaskar reddy

  • Jun 30th, 2006
 

Hi

Plz any one can explain clearlly abt unchecked exception with exampls.

thanks and regards

bhaskar

  Was this answer useful?  Yes

jitendra

  • Jul 2nd, 2006
 

just try to implement divide by zero expression it will thorw an exception which is unchecked. runtimeException.

  Was this answer useful?  Yes

Amit Patil

  • Sep 19th, 2007
 

There are two types of exceptions checked and unchecked expections:

1.Checked exceptions are exceptions which are expected and thrown and handled in a well written program.For example if you are reading from a file,it may be anticipated that the file does not exist.Hence you write code to handle it.
Handling exception includes usage of try ,catch,finally block.You can alternatively throw and exception to handle it higher in method call stack.

A programmer is forced to handle checked exceptions else there is a compiler error

2.Unchecked exceptions need not be handled.A program is expected to never recover from this exceptions.For example NullPointerException.

A programmer has a option of handling unchecked exceptions or he may choose to ignore them.

  Was this answer useful?  Yes

Visithra.G

  • Oct 6th, 2020
 

It is essential to catch declare throws clause for checked exceptions unchecked exception need not be handled.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions