zno2

checked unchecked Exception

https://docs.oracle.com/javase/specs/jls/se8/html/jls-11.html

 

 

 

 

That is, the checked exception classes are Throwable and all its subclasses other than RuntimeException and its subclasses and Error and its subclasses.

 

 

两类:checked exceptions 和 unchecked exception 。

        "s".getBytes("utf-8");
        
        Integer.valueOf("s");

 


一个是编译期间(compile-time),必须处理,不然编译不通过。

一个是运行期间(run-time)

常见的运行时异常:

  • ClassCastException
  • IndexOutOfBoundsException
  • NullPointerException
  • IllegalArgumentException
  • AuthenticationException
  • AuthorizationException
  • DuplicateKeyException

 

posted on 2016-08-07 09:51  zno2  阅读(187)  评论(0编辑  收藏  举报

导航