博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Checked Exception VS unChecked Exception

Posted on 2014-03-12 20:00  钟悍  阅读(235)  评论(0编辑  收藏  举报

1, unChecked Exception,  represent a defect in programmer(bugs).  should inherit RuntimeException or Error.

Unchecked runtime exceptions represent conditions that, generally speaking, reflect errors in your program's logic and cannot be reasonably recovered from at run time.

2, checked Exception, represent invalid conditions in areas outside the immediate control of the program (invalid user input, database problems, network outages, absent files).

 

class Throwable implements Serializable

     --Exception extends Throwable                   ------checkException    //should consider this situation in your programmer.

           --RuntimeException  extends Exception ------uncheckException  //bugs

     --Error extends Throwable.                         ------uncheckException  //Error

 

Angry   Angry  Angry  Angry

I'm very angry, help I will nerver forget. Gold bless me.