-3

我正在尝试了解 Java 中的异常,并且出于教育目的,如果我能获得标准 API 中所有已检查异常和所有未检查异常的引用,那就太好了。

相关问题,但不完全是我所追求的。

4

1 回答 1

2

查看. _ _ Exception所有这些异常(除了RuntimeException)都是示例检查异常:

AclNotFoundException
ActivationException
AlreadyBoundException
ApplicationException
AWTException
BackingStoreException
BadAttributeValueExpException
BadBinaryOpValueExpException
BadLocationException
BadStringOperationException
BrokenBarrierException
CertificateException
CloneNotSupportedException
DataFormatException
DatatypeConfigurationException
DestroyFailedException
ExecutionException
ExpandVetoException
FontFormatException
GeneralSecurityException
GSSException
IllegalClassFormatException
InterruptedException
IntrospectionException
InvalidApplicationException
InvalidMidiDataException
InvalidPreferencesFormatException
InvalidTargetObjectTypeException
IOException
JAXBException
JMException
KeySelectorException
LastOwnerException
LineUnavailableException
MarshalException
MidiUnavailableException
MimeTypeParseException
MimeTypeParseException
NamingException
NoninvertibleTransformException
NotBoundException
NotOwnerException
ParseException
ParserConfigurationException
PrinterException
PrintException
PrivilegedActionException
PropertyVetoException
ReflectiveOperationException
RefreshFailedException
RemarshalException
RuntimeException
SAXException
ScriptException
ServerNotActiveException
SOAPException
SQLException
TimeoutException
TooManyListenersException
TransformerException
TransformException
UnmodifiableClassException
UnsupportedAudioFileException
UnsupportedCallbackException
UnsupportedFlavorException
UnsupportedLookAndFeelException
URIReferenceException
URISyntaxException
UserException
XAException
XMLParseException
XMLSignatureException
XMLStreamException
XPathException

RuntimeException

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

这些是直接子类,所以这个列表还远未完成。检查的异常IOException具有以下子类:

ChangedCharSetException
CharacterCodingException
CharConversionException
ClosedChannelException
EOFException
FileLockInterruptionException
FileNotFoundException
FilerException
FileSystemException
HttpRetryException
IIOException
InterruptedByTimeoutException
InterruptedIOException
InvalidPropertiesFormatException
JMXProviderException
JMXServerErrorException
MalformedURLException
ObjectStreamException
ProtocolException
RemoteException
SaslException
SocketException
SSLException
SyncFailedException
UnknownHostException
UnknownServiceException
UnsupportedDataTypeException
UnsupportedEncodingException
UserPrincipalNotFoundException
UTFDataFormatException
ZipException
于 2015-06-07T15:30:33.443 回答