Java exception and Error class summary
Recently because of exams and previous interviews often encounter Java Exception class inheritance level problem, make very head, because the Java anomaly is a little more, it is difficult to write down, today just check some data sorted down, hope for himself and everyone a little help. At the beginning of the habit of using a notebook (handwritten paper book) notes, later found that the time is not very convenient, and slow. Later instead of Notepad began to remember, feeling very good, easy to use, no fancy things. But there are also its shortcomings, such as the layout of the collation, can not add some pictures (often pictures, especially some of the outline is very good memory learning methods) and so on, so try to start writing with Markdown, put on the blog after a convenient access, but also to let everyone share, learning progress together. From the beginning to learn computer related fields Until now, thank you very much at home and abroad Daniel Selfless sharing, really learned a lot, and then continue to learn knowledge at the same time, to this pasted, but also to write something to share with you, welcome to point out the deficiencies and mistakes, and learn together.
Main classes of Java exceptions and errors
Java exceptions are divided into exceptions and errors, exception and error, two classes, those two classes are inherited from the Throwable class, Throwable is the root of all Java exceptions.
All Java exception classes, including Throwable,exception,error, are all classes, so they can be instantiated (written tests often come across).
Error: Errors that cannot be handled well by the program (cannot is handled reasonably by programs)
There's not enough memory in the machine.
JVM crashes (it is possible that the program will be dead)
The thread is dead.
...
Exception: Can be processed by programs (can handled by program)
IO error (keyboard, disk)
Network error
Non-legitimate type conversions
Array or container out of bounds
Java exceptions are generally divided into run-time and Run-time exceptions
Runtime exception is all subclasses of runtimeexception
Non-run-time exceptions are all other child classes of exception, such as Ioexception,interruptedexception
Second, the Java anomaly structure diagram
Three, Java exception detailed class hierarchy
All the anomalies inside the Java.lang package.
Java.lang.Throwable (Implements Java.io.Serializable)
Java.lang.Error
Java.lang.AssertionError
Java.lang.LinkageError
Java.lang.BootstrapMethodError
Java.lang.ClassCircularityError
Java.lang.ClassFormatError
Java.lang.UnsupportedClassVersionError
Java.lang.ExceptionInInitializerError
Java.lang.IncompatibleClassChangeError
Java.lang.AbstractMethodError
Java.lang.IllegalAccessError
Java.lang.InstantiationError
Java.lang.NoSuchFieldError
Java.lang.NoSuchMethodError
Java.lang.NoClassDefFoundError
Java.lang.UnsatisfiedLinkError
Java.lang.VerifyError
Java.lang.ThreadDeath
Java.lang.VirtualMachineError
Java.lang.InternalError
Java.lang.OutOfMemoryError
Java.lang.StackOverflowError
Java.lang.UnknownError
Java.lang.Exception
Java.lang.CloneNotSupportedException
Java.lang.InterruptedException
Java.lang.ReflectiveOperationException
Java.lang.ClassNotFoundException
Java.lang.IllegalAccessException
Java.lang.InstantiationException
Java.lang.NoSuchFieldException
Java.lang.NoSuchMethodException
Java.lang.RuntimeException
Java.lang.ArithmeticException
Java.lang.ArrayStoreException
Java.lang.ClassCastException
Java.lang.EnumConstantNotPresentException
Java.lang.IllegalArgumentException
Java.lang.IllegalThreadStateException
Java.lang.NumberFormatException
Java.lang.IllegalMonitorStateException
Java.lang.IllegalStateException
Java.lang.IndexOutOfBoundsException
Java.lang.ArrayIndexOutOfBoundsException
Java.lang.StringIndexOutOfBoundsException
Java.lang.NegativeArraySizeException
Java.lang.NullPointerException
Java.lang.SecurityException
Java.lang.TypeNotPresentException
Java.lang.UnsupportedOperationException
All IO exceptions in the java.io package
Ava.lang.Exception
Java.io.IOException
Java.io.CharConversionException
Java.io.EOFException
Java.io.FileNotFoundException
Java.io.InterruptedIOException
Java.io.ObjectStreamException
Java.io.InvalidClassException
Java.io.InvalidObjectException
Java.io.NotActiveException
Java.io.NotSerializableException
Java.io.OptionalDataException
Java.io.StreamCorruptedException
Java.io.WriteAbortedException
Java.io.SyncFailedException
Java.io.UnsupportedEncodingException
Java.io.UTFDataFormatException
The above Java exception and error class summary (must see article) is a small series to share all the content, hope to give you a reference, but also hope that we support cloud habitat community.