java常见异常
java异常就分两种,1.runtimeException,运行时异常 2.编译时异常。
异常的基类为Throwable,常见的runtimeException(注,只有runtimeexception能在代码中忽略,其它类型的异常的处理都是有编译器强制实施)有:
a.arrayindexoutofboundsException
b.IllegalArguementException
c.NullPointException
d.bufferUnderflowException
e.总的:AnnotationTypeMismatchException, ArithmeticException, ArrayStoreException, BufferOverflowException, BufferUnderflowException, CannotRedoException, CannotUndoException,ClassCastException, CMMException, ConcurrentModificationException, DataBindingException, DOMException, EmptyStackException, EnumConstantNotPresentException,EventException, FileSystemAlreadyExistsException, FileSystemNotFoundException, IllegalArgumentException, IllegalMonitorStateException, IllegalPathStateException,IllegalStateException, IllformedLocaleException, ImagingOpException, IncompleteAnnotationException, IndexOutOfBoundsException, JMRuntimeException, LSException,MalformedParameterizedTypeException, MirroredTypesException, MissingResourceException, NegativeArraySizeException, NoSuchElementException, NoSuchMechanismException,NullPointerException, ProfileDataException, ProviderException, ProviderNotFoundException, RasterFormatException, RejectedExecutionException, SecurityException,SystemException, TypeConstraintException, TypeNotPresentException, UndeclaredThrowableException, UnknownEntityException, UnmodifiableSetException,UnsupportedOperationException, WebServiceException, WrongMethodTypeException
而非运行时类型有:
- AWTException
- IOException
- ApplicationException等等,不一一列举