wood burning stoves 2.0*
The moose likes Certification Results and the fly likes What are the below exception Statement can any one explain them? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Certification Results
Bookmark "What are the below exception Statement can any one explain them?" Watch "What are the below exception Statement can any one explain them?" New topic
Author

What are the below exception Statement can any one explain them?

Lal Mothi
Greenhorn

Joined: Nov 03, 2007
Posts: 4
Catch (Exception e),
Catch (Error err),

Catch (Throwable t)


D.Mothi Lal
Jitendra Jha
Ranch Hand

Joined: Jan 28, 2007
Posts: 91
There are three Catch statements.As we know that java's Exception handling mechanism is derived from the Throwable interface,so the throwable is at the top of exception hierarchy.it has two subclasses,namely error and exception.we can say that both of these are peer classes.
In your statement,Exceptions of type Exception are handled by Exception catch and of type error will be handled by error catch.
Though java allows catch blocks to be organised in a subclass to superclass order,but i doubt that your code will ever need the throwable catch as all exceptions are handled by the first 2 catch blocks


Jitendra
SCJP1.5
SCWCD1.5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What are the below exception Statement can any one explain them?
 
Similar Threads
Doubt in Exception Handling.
NaturalLanguageMultiply: Exceptions
Resume of program
Can you throw too many exceptions?
DataClient Adapter pattern