java常见异常

java异常就分两种,1.runtimeException,运行时异常 2.编译时异常。

异常的基类为Throwable,常见的runtimeException(注,只有runtimeexception能在代码中忽略,其它类型的异常的处理都是有编译器强制实施)有:

a.arrayindexoutofboundsException

b.IllegalArguementException

c.NullPointException

d.bufferUnderflowException

e.总的:AnnotationTypeMismatchExceptionArithmeticExceptionArrayStoreExceptionBufferOverflowExceptionBufferUnderflowExceptionCannotRedoExceptionCannotUndoException,ClassCastExceptionCMMExceptionConcurrentModificationExceptionDataBindingExceptionDOMExceptionEmptyStackExceptionEnumConstantNotPresentException,EventExceptionFileSystemAlreadyExistsExceptionFileSystemNotFoundExceptionIllegalArgumentExceptionIllegalMonitorStateExceptionIllegalPathStateException,IllegalStateExceptionIllformedLocaleExceptionImagingOpExceptionIncompleteAnnotationExceptionIndexOutOfBoundsExceptionJMRuntimeExceptionLSException,MalformedParameterizedTypeExceptionMirroredTypesExceptionMissingResourceExceptionNegativeArraySizeExceptionNoSuchElementExceptionNoSuchMechanismException,NullPointerExceptionProfileDataExceptionProviderExceptionProviderNotFoundExceptionRasterFormatExceptionRejectedExecutionExceptionSecurityException,SystemExceptionTypeConstraintExceptionTypeNotPresentExceptionUndeclaredThrowableExceptionUnknownEntityExceptionUnmodifiableSetException,UnsupportedOperationExceptionWebServiceExceptionWrongMethodTypeException

而非运行时类型有:

  • AWTException
  • IOException
  • ApplicationException等等,不一一列举
原文地址:https://www.cnblogs.com/mapleyuan/p/2981445.html