Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

try within a try statement

 
Shrawan Bhageria
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
pl. let me know
Is it possible to write a try within a try statement

thanks
shrawan

SCJP1.4,SCWCD1.4,MCP
SCBCD(preparing)
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you try it and find out?

Moving to Java in General (Beginner).
 
Casper Maxwell
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as i remember, it is possible. But i can't think any need for this.
 
Henry Wong
author
Marshal
Pie
Posts: 21208
81
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Casper Casper:
As far as i remember, it is possible. But i can't think any need for this.


Yes it is possible... and the classic case is when you need to simply call sleep() and wait(), and don't mind returning early. You simply wrap it with a try-catch, and just continue. This is, of course, may be in another larger try block.

Henry
 
Mark Wuest
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ernest Friedman-Hill:
Why don't you try it and find out?

(emphasis mine)

Groan!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic