This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes About Try-Catch Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "About Try-Catch" Watch "About Try-Catch" New topic
Author

About Try-Catch

kayanaat sidiqui
Ranch Hand

Joined: Sep 04, 2008
Posts: 122
Hi there,
Well i just want to know that, is there any limit to the number of "catch" block associated with a try block?
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Not that I'm aware of. But if your code starts getting unmanageable, you might want to rethink your approach.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
kayanaat sidiqui
Ranch Hand

Joined: Sep 04, 2008
Posts: 122
Thanks weber, but i want the answer in exact figure, if any. Approach is different thing while limit is something else, And i want that limit over the number of catch block if it is there by sun team while developing jdk1.5.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Sounds like some exceptional code you're contemplating.

I don't know the answer, but I suspect the Zero One Infinity (ZOI) rule might apply here.
[ October 11, 2008: Message edited by: marc weber ]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38075
    
  22
Have you been through the Java Language Specification and the Virtual Machine Specification? You will find Marc is correct if you go through them.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

The only limit is probably the size limit of both source file and class file.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
kayanaat sidiqui
Ranch Hand

Joined: Sep 04, 2008
Posts: 122
Thank you Marc, Campbell and Rob.
kayanaat sidiqui
Ranch Hand

Joined: Sep 04, 2008
Posts: 122
And Rob, i have a humble request for you, please make some space in your private message box because i tried to send you a private message but it couldn't be delivered. Thank you.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

I cleaned up most of the name warning PM's
I should have enough space for a while now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About Try-Catch
 
Similar Threads
JQ+ question
Text Boxes and JSP
NullPointerException, but no root cause
Query on JTA and session.flush()
Unreachable statement