美文网首页
jdk_异常处理

jdk_异常处理

作者: 時間_77c1 | 来源:发表于2018-07-09 14:15 被阅读0次

    类结构:

    image.png

    The Throwable class is the superclass of all errors and exceptions in the Java language. Only objects that are instances of this class (or one of its subclasses) are thrown by the Java Virtual Machine or can be thrown by the Java throw statement.

    Java provides three kinds of throwables:

    checked exceptions,:except runtime exceptions: Errors

    runtime exceptions: is the superclass of those exceptions that can be thrown during the normal operation of the Java Virtual Machine.

    Errors.: a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. Most such errors are abnormal conditions.

    Errors and runtime exceptions and compile-time checking of exceptions

    grammar:

    Try {

    }catch(...){

    }finally(

    )

    Exception chain 异常链:

    以一个异常对象为参数构造新的异常对象。新的异对象将包含先前异常的信息

    Customer exception 自定义异常:拓展exception

    Eg: IoException

    image.png

    相关文章

      网友评论

          本文标题:jdk_异常处理

          本文链接:https://www.haomeiwen.com/subject/kqzzuftx.html