本文主要记录java的异常体系

概览

Exception

Java的异常体系

分checked exception以及unchecked exception(runtime exception)

  • checked exception
    除runtime exception外的exception。

    • ReflectiveOperationException(ClassNotFoundException、 NoSuchFieldException、NoSuchMethodException)

    • IOException(FileNotFoundException、FileExistsException)

    • IOException(SocketException、SocketTimeoutException)

    • SQLException

    • InterruptedException、TimeoutException

    • URIReferenceException、URISyntaxException

    • XMLSchemaException、XMLParseException、XMLStreamException

  • runtime exception
    NullPointerException、NumberFormatException、ArrayIndexOutOfBoundsException、StringIndexOutOfBoundsException、ClassCastException、ArithmeticException、IllegalArgumentException

Error

Java的异常体系

Error表示致命错误,比如OutOfMemoryError,NoSuchMethodError

相关文章:

  • 2021-12-23
猜你喜欢
  • 2021-07-08
  • 2021-12-23
  • 2021-05-18
  • 2021-12-23
  • 2021-12-23
  • 2021-12-23
  • 2021-12-23
相关资源
相似解决方案