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

how a marker interface gets its functionality and when we implements a marker interface how it got invoked

3 Answers   Mind Tree,


Why do we need strings in java?

0 Answers  


what is a package?

11 Answers  


What is a flag and how does it work?

0 Answers  


Why is java not 100% pure oops?

0 Answers  






What is communist flag?

0 Answers  


What are internal variables?

0 Answers  


How destructors are defined in java?

0 Answers  


What is indexof?

0 Answers  


Can we create our own wrapper class in java?

0 Answers  


class{ ... ... interface myinterface{ ... ... } abstract class{ .. .. } ... .. .. } is this possible to write "Interface and/ or Abstract class inside a class ? if possible whcich one is possible is only interface? is only abstract?

2 Answers   Logica CMG,


What is the purpose of lambda expressions?

0 Answers  


Categories