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

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

Joined: Sep 20, 2010
Posts: 3657

The same place it returns to outside the try block. Ask yourself, where does return normally return to?
Consider Paul's rocket mass heater.
subject: return in catch block!