Core Java Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 274 Page Views: 

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



Posted By: Avi Date: 4 November 2010 01:09:55 PM
 Answer:

When an exception is thrown within the body of a try statement, 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 executed. The remaining catch clauses are ignored.


Posted By: avibtech


Date: 4 November 2010 01:09:55 PM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image oBH4bk
Related Questions
Core Java : Does a class inherit the constructors of its superclass?

Does a class inherit the constructors of its superclass?

A class does not inherit constructors from any of its superclasses.
Category: Core Java Date: 11/6/2010 10:47:46 AM
Core Java : What restrictions are placed on method overriding?

What restrictions are placed on method overriding?

Overridden methods must have the same name, argument list, and return type.
Category: Core Java Date: 11/6/2010 9:31:49 AM
Core Java : Can an Interface not be private or protected?

Can an Interface not be private or protected?

yes
Category: Core Java Date: 11/6/2010 8:58:47 AM
Core Java : What is JAR file?

What is JAR file?

JAR(Java Archive) is a file format that enables you to bundle multiple files into a single archive f....
Category: Core Java Date: 11/4/2010 12:05:47 AM
Core Java : What is a task's priority and how is it used in scheduling?

What is a task's priority and how is it used in scheduling?

A task's priority is an integer value that identifies the relative order in which it should be execu....
Category: Core Java Date: 11/3/2010 11:53:53 PM