How To Escape an Exception.

Hi all,

           If i know an exception will arise and i want to ignore it, how to do that... ??
 
          do i write anything in the catch block to ignore that exception ??

Thanks
letsbedecentAsked:
Who is Participating?
 
objectsCommented:
try
{
   doSomethingThatMayCauseAnExcptionImNotInterestedIn();
}
catch (BoringException ex)
{
   // no nothing
}
0
 
objectsCommented:
you just have an empty catch block
0
 
letsbedecentAuthor Commented:
but then it is printing the stack trace ... even if i leave the block empty..

I actually want to continue with the execution of the rest of the program
0
 
letsbedecentAuthor Commented:
Oh no it works... thanks...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.