• Post Reply Bookmark Topic Watch Topic
  • New Topic

will using try/catch reduce performance?????  RSS feed

 
Nandan Palvalli
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will the usage of try/catch block reduce the performance of java program??
consider this case:
a variable is used inside try/catch block,
is there any performance boost if i declare that variable outside try/catch block instead of inside the try/catch block.???
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This isn't much to do with the SCJP. Moving this to the Performance forum...
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has been discussed before. Summary: The cost is so insignificant that trying to optimize try-catch placement is a bad idea.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!