aspose file tools*
The moose likes Beginning Java and the fly likes return in catch block! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "return in catch block!" Watch "return in catch block!" New topic
Author

return in catch block!

Nick Petas
Ranch Hand

Joined: Jan 31, 2007
Posts: 38
What does a single return in a catch block do?
Thank you.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Nothing less or more then a regular return statement. Why don't you try it?


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Nick Petas
Ranch Hand

Joined: Jan 31, 2007
Posts: 38
Where exactly does it return?In the try block?
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3379
    
    9
The same place it returns to outside the try block. Ask yourself, where does return normally return to?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: return in catch block!
 
Similar Threads
Statement not reachable??
Exception
question about return?
catch statements
missing expression error