This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Java in General and the fly likes Can you have a try/catch inside a try Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Can you have a try/catch inside a try " Watch "Can you have a try/catch inside a try " New topic
Author

Can you have a try/catch inside a try

Robert Johnson
Ranch Hand

Joined: Feb 11, 2005
Posts: 32
can you have a try and catch inside a try block

???


Whats in a name?
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

answer is yes.


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Or inside a catch block or a finally block. You can do pretty much anything inside one set of curly braces that you could do inside any other set of curly braces.

Too much nesting gets messy and hard to read, so it's probably a hint that you should pull the nested bits out to their own methods.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Too much nesting gets messy and hard to read, so it's probably a hint that you should pull the nested bits out to their own methods.


EXACTLY. Sorry to yell that.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
GeeCON Prague 2014
 
subject: Can you have a try/catch inside a try