Common runtimeException summary in development or interview
The common types are as follows:
NullPointerException – null pointer reference exception
ClassCastException – type cast exception.
Illegalargumentexception – pass illegal parameter exception.
Arithmeticexception – arithmetic operation exception
arraystoreexception – storing objects incompatible with declared types into an array exception
indexoutofboundsexception – subscript out of bounds exception
negativearraysizeexception – creating an array with negative size error exception
numberformatexception – number format exception
SecurityException – Security Exception
exception Unsupported operationexception – unsupported operation exception
Arithmetic exception class: arithmeticexception
null pointer exception class: NullPointerException
type coercion exception: ClassCastException
array negative subscript exception: negativearrayexception
array subscript out of bounds exception: ArrayIndexOutOfBoundsException
security violation exception: SecurityException
file ended exception: eofexception
exception File not found exception: FileNotFoundException
string converted to number exception: numberformatexception
operation database exception: sqlexception
input/output exception: IOException
method not found exception: nosuchmethodexception
Java.lang.AbstractMethodError
Abstract method error. Thrown when an application attempts to call an abstract method.
java.lang.AssertionError
Wrong assertion. Used to indicate the failure of an assertion.
java.lang.ClassCircularityError
Class loop dependency error. When initializing a class, if a circular dependency between classes is detected, the exception is thrown.
java.lang.ClassFormatError
Class format error. Thrown when the Java virtual machine attempts to read a Java class from a file and detects that the contents of the file do not conform to the valid format of the class.
java.lang.Error
Wrong. Is the base class for all errors and is used to identify serious program running problems. These problems usually describe anomalies that should not be captured by the application.
java.lang.ExceptionInInitializerError
Initializer error. Thrown when an exception occurs during the execution of a class’s static initializer. Static initializers are static statements directly contained in classes.
java.lang.IllegalAccessError
Illegal access error. When an application attempts to access, modify the field of a class or call its method, but violates the visibility declaration of the field or method, it throws the exception.
java.lang.IncompatibleClassChangeError
Incompatible class change error. This exception is thrown when the class definition on which the executing method depends is changed incomparably. Generally, it is easy to cause this error when the declaration definition of some classes in the application is modified without recompiling the whole application.
java.lang.InstantiationError
Instantiation error. This exception is thrown when an application attempts to construct an abstract class or interface through Java’s new operator.
this exception is thrown java.lang.InternalError
Internal error. Used to indicate that an internal error has occurred in the Java virtual machine.
java.lang.LinkageError
Link error. This error and all its subclasses indicate that a class depends on other classes. After the class is compiled, the dependent class changes its class definition and does not recompile all the classes, thus causing an error.
java.lang.NoClassDefFoundError
Class definition error not found. This error is thrown when a Java virtual machine or class loader attempts to instantiate a class and cannot find its definition.
java.lang.NoSuchFieldError
There are no errors in the domain. This error is thrown when an application attempts to access or modify a domain of a class, but there is no definition of the domain in the definition of the class.
java.lang.NoSuchMethodError
Method has no errors. This error is thrown when an application attempts to call a method of a class and there is no definition of the method in the definition of the class.
java.lang.OutOfMemoryError
Out of memory error. This error is thrown when the available memory is insufficient for the Java virtual machine to allocate to an object.
java.lang.StackOverflowError
Stack overflow error. This error is thrown when the level of an application recursive call is too deep to cause a stack overflow.
java.lang.ThreadDeath
The thread ends. This error is thrown when the stop method of the thread class is called to indicate the end of the thread.
java.lang.UnknownError
Unknown error. Used to indicate that an unknown fatal error has occurred in the Java virtual machine.
java.lang.UnsatisfiedLinkError
Unsatisfied link error. Thrown when the Java virtual machine does not find a native language definition of a class declared as a native method.
java.lang.UnsupportedClassVersionError
Unsupported class version error. When the Java virtual machine attempts to read a class file from, but finds that the major and minor version numbers of the file are not supported by the current Java virtual machine, this error is thrown.
java.lang.VerifyError
Validation error. This error is thrown when the verifier detects an internal incompatibility or security problem in a class file.
java.lang.VirtualMachineError
Virtual machine error. It is used to indicate that the virtual machine is damaged or insufficient resources are needed to continue the operation.
java.lang.ArithmeticException
The arithmetic condition is abnormal. For example: integer divided by zero and so on.
java.lang.ArrayIndexOutOfBoundsException
Array index out of bounds exception. Thrown when the index value to the array is negative or greater than or equal to the size of the array.
java.lang.ArrayStoreException
Array storage exception. Thrown when a non array declaration type object is placed in an array.
java.lang.ClassCastException
Class shape exception. Suppose that there are classes a and B (a is not the parent or child of B), and O is an instance of a, then this exception will be thrown when o is forced to be constructed as an instance of class B. This exception is often referred to as a cast exception.
java.lang.ClassNotFoundException
Class exception not found. When the application attempts to construct a class according to the class name in the form of a string, and cannot find the class file with the corresponding name after traversing the classpath, it throws this exception.
java.lang.CloneNotSupportedException
Clone exception is not supported. When the Cloneable interface is not implemented or the clone method is not supported, the clone () method will throw this exception.
java.lang.EnumConstantNotPresentException
Enumeration constant has no exception. This exception is thrown when an application attempts to access an enumeration object by name and enumeration type, but the enumeration object does not contain a constant.
java.lang.Exception
Root exception. Describes what the application wants to capture.
java.lang.IllegalAccessException
Illegal access exception. This exception is thrown when an application attempts to create an instance of a class, access its properties, and call its methods through reflection, but it cannot access the definition of class, property, method, or construction method.
java.lang.IllegalMonitorStateException
Illegal monitoring status is abnormal. This exception is thrown when a thread tries to wait for a monitor of an object (o) that it does not own, or notifies other threads to wait for the monitor of the object (o).
java.lang.IllegalStateException
The illegal state is abnormal. When the Java environment and application are not in the legal calling state of a method, and the method is called, the exception is thrown.
java.lang.IllegalThreadStateException
Illegal thread state exception. When a method is called while it is not in legal calling state, an exception is thrown.
java.lang.IndexOutOfBoundsException
Index out of bounds exception. When the index value of accessing a sequence is less than 0 or greater than or equal to the sequence size, the exception is thrown.
java.lang.InstantiationException
Instantiation exception. This exception is thrown when an attempt is made to create an instance of a class that is an abstract class or interface through the newinstance() method.
java.lang.InterruptedException
Aborted exception. When a thread is in a long waiting, sleeping or other pause state, and other threads terminate the thread through the interrupt method of thread, this exception is thrown.
java.lang.NegativeArraySizeException
Negative array size exception. This exception is thrown when an array is created with a negative size value.
java.lang.NoSuchFieldException
Property has no exception. This exception is thrown when accessing a nonexistent property of a class.
java.lang.NoSuchMethodException
Method has no exception. This exception is thrown when a nonexistent method of a class is accessed.
java.lang.NullPointerException
Null pointer exception. This exception is thrown when the application attempts to use null where the object is required. For example: call instance method of null object, access property of null object, calculate length of null object, throw null with throw statement, etc.
java.lang.NumberFormatException
The number format is abnormal. This exception is thrown when an attempt is made to convert a string to a specified numeric type and the string does not meet the format required by the numeric type.
java.lang.RuntimeException
Runtime exception. Is the parent of all exceptions that can be thrown during normal operation of Java virtual machine.
java.lang.SecurityException
Security exception. An exception thrown by the security manager to indicate a security violation.
java.lang.StringIndexOutOfBoundsException
String index out of bounds exception. When the index value is used to access characters in a string and the index value is less than 0 or greater than or equal to the sequence size, the exception is thrown.
java.lang.TypeNotPresentException
There is no exception for the type. This exception is thrown when an application attempts to access a type in a string representation of the type name, but cannot find the type according to the given name. The difference between this exception and classnotfoundexception is that it is an unchecked exception, while classnotfoundexception is a checked exception.
java.lang.UnsupportedOperationException
Unsupported method exception. Exception indicating that the requested method is not supported.