File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes catch and finally Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "catch and finally" Watch "catch and finally" New topic

catch and finally


Joined: Jun 30, 2001
Posts: 1
can finally block substitude catch block? like
Andy Skalkin
Ranch Hand

Joined: Apr 05, 2001
Posts: 33
Yes it can.
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Hi redmouse,
Please read the JavaRanch Name Policy and re-register using a name that complies with the rules.
Thanks for your cooperation.
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform

Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
Anshul Manisha
Ranch Hand

Joined: Apr 17, 2001
Posts: 74
Yes it can but if the code in the try block is throwing any checked exception it must have a catch block or must be declared in the method.
Originally posted by redmouse:
can finally block substitude catch block? like

AM<BR> <A HREF="" rel="nofollow"></A>
I agree. Here's the link:
subject: catch and finally
Similar Threads
Exception in finally
can we define try without finally
JQ+ question
When finally block does not run?
Unreachable statement