【问题标题】:Reference of all checked / unchecked exceptions in the standard API [closed]标准 API 中所有已检查/未检查异常的参考 [关闭]
【发布时间】:2015-06-07 15:03:51
【问题描述】:

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

Related question 但不是我想要的。

【问题讨论】:

  • 您想要标准 API 中所有已检查和所有未检查异常类的列表?
  • 是的,这就是我想要的,但我在下面找到了答案。
  • 感谢编辑:)

标签: java checked-exceptions unchecked-exception


【解决方案1】:

查看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

【讨论】:

  • 反对者,想发表评论吗?
  • 非常感谢。您的列表很大。
  • 根据我的最后一句话,它仍然不完整 :-)(如果你觉得它有用,你介意给我一个赞成票来反对那个反对票吗?)
  • 已经做到了。不过,我也不介意有人问我的问题;)
  • 我把它改写成更适合这个论坛的格式。 (不过,您可能想删除自己的答案......它确实遗漏了更多内容。)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多