exception statements

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cody Manix

    #1

    exception statements

    is there any difference between

    try{}catch(Exce ption){}

    and

    try{}catch{} ?

    if not, why this short syntax? i think it encourages programmers especially
    beginners to catch all exceptions instead of catching a specific exception
    which is a better style of programming. one could only under rare
    circumstances catch all exceptions.

    and i have another question. is there a difference between:

    catch(Exception e){throw e;}

    and

    catch(Exception e){throw new Exception(e);}

    which one is better for rethrowing an exception?

    thx for answering me in advance!

    --
    cody

    Freeware Tools, Games and Humour

    [noncommercial and no fucking ads]



Working...