In this section, briefly talk about exceptions in Java
An anomaly architecture diagram
(From: http://zhidao.baidu.com/link?url=Hvad_t9sT-wsvFHZgM3dSw1CIIPcwMfz-8japqHsAc_ Nij9mmfzjycondyelwrq-g8abcqxvbkwu0wanupsun_)
Two Exception
By visible exception There are two main subclasses runtimeexception (also called checkedexception) and Checkedexception
RuntimeException: (also called checkedexception) is a run-time exception, also known as a non-inspected exception, the programmer does not need to capture at compile time, the runtime will not occur in the exception,
Checkedexception: checked exception, i.e. manual Try catch must be made at compile time
Three, a brief analysis of the common anomalies of two kinds of anomalies
A Common RuntimeException
NullPointerException-NULL pointer reference exception
ClassCastException-type cast exception.
IllegalArgumentException-Pass an illegal parameter exception.
ArithmeticException-Arithmetic Operation exception
Arraystoreexception-Storing an incompatible object exception with the declaration type in the array
Indexoutofboundsexception-Subscript out-of-bounds exception
Negativearraysizeexception-Create an array error exception with a negative size
NumberFormatException-Numeric Format exception
SecurityException-Security exception
Unsupportedoperationexception-Unsupported Operation exception
Concurrentmodificationexception-Concurrency modification exception, which occurs when a collection is traversed with remove or modify
B Common Checkedexception
ClassNotFoundException: Class not found exception
clonenotsupportedexcepti< Span style= "color: #323e32; Font-family:verdana, song body, Sans-serif; line-height:18px; " >on: Cloning is not supported, generally occurs for implementing the Cloneable interface
dataformatexception: Data format conversion exception
illegalaccessexception: Security privilege exception, in general, is due to the
that is caused by the private method invoked by Java during reflection
interruptedexception: Thread Break exception
Ioexception:io Stream Exception。 This problem usually occurs when you read and write data.
&NBSP;
sqlexception: manipulating database exceptions
TimeoutException: Timeout exception
filenotfountexception: File not found exception
On Java exceptions