How does a try statement determine which catch clause
should be used to handle an exception?

Answers were Sorted based on User's Feedback



How does a try statement determine which catch clause should be used to handle an exception?..

Answer / guest

when an exception is thrown with in the body of the try
statement then the catch clauses of the try statement are
examined in the order in which they appear.The first catch
clause that is capable of handling the exception is caught
and the remaining are ignored.

Is This Answer Correct ?    8 Yes 0 No

How does a try statement determine which catch clause should be used to handle an exception?..

Answer / vatti

when an exception is thrown from the try block,the type of
exception object specified in the catch statement matches
with the exception thrown, that one will execute

Is This Answer Correct ?    5 Yes 1 No

Post New Answer

More Core Java Interview Questions

What is the difference between error and exception and explain in simple words not whatever is given in the book.

7 Answers  


Which package is imported by default?

0 Answers  


How do you escape in java?

0 Answers  


Name few java.lang classes introduced with java 8 ?

0 Answers  


Explain Public static void main?

2 Answers   IBM, Vetech,


How to connect to a remote database using Applet?

0 Answers  


Explain throw keyword in java?

0 Answers  


Explain role of constructor in a java application?

5 Answers  


Why does the integer quotient -0/3 yield 0, but the double quotient -0.0/3.0 yields – 0.0?

0 Answers  


How can you set an applet’s height and width as a percentage?

0 Answers  


What are the differences between processes and threads?

0 Answers  


What is a class variable?

0 Answers  


Categories