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 to create an immutable class?

0 Answers  


What happens when you add a double value to a string?

0 Answers  


Define the term string pool?

0 Answers  


Which method cannot be overridden in java?

0 Answers  


From the two, which would be easier to write: synchronization code for ten threads or two threads?

0 Answers  






What is meant by class loader? How many types are there? When will we use them?

0 Answers  


What’s the difference between constructors and other methods?

0 Answers  


What happens if constructor is private?

0 Answers  


what is Remote Reference Layer ?

1 Answers  


Relationship between an event-listener interface and an event-adapter class?

1 Answers  


What is the association?

0 Answers  


What is hard code & soft code?

7 Answers   Cognizant, Wipro,


Categories