A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Java
»
Java in General
Author
Exception Handling
Manu Sharma
Greenhorn
Joined: Apr 03, 2006
Posts: 2
posted
May 10, 2006 05:12:00
0
Hi,
I am trying to call my own method after the try block of "try{} catch {} block ". Is it possible to do so? Means not going to catch block the flow should go to my own defined method.
Manish
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
I like...
posted
May 10, 2006 05:20:00
0
This is fine:
try { // code } catch(Exception e) { // handle exception } myMethod();
Or do you mean something else?
JavaRanch FAQ
HowToAskQuestionsOnJavaRanch
Manu Sharma
Greenhorn
Joined: Apr 03, 2006
Posts: 2
posted
May 11, 2006 02:37:00
0
Hi Paul,
what i mean is after try block my method should get call, not the catch block.
what u have shown is the same? is it?
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
I like...
posted
May 11, 2006 04:15:00
0
what u have shown is the same? is it?
Yes. Assuming nothing in the try block throws an Exception, in which case the code in the catch block will be called before myMethod().
I agree. Here's the link:
http://aspose.com/file-tools
subject: Exception Handling
Similar Threads
Need for finally block?
Query regarding finally method
Exceptions
Catching exception not thrown in try clause
Rethrow an exception in Java ?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter