Common RuntimeException and runtimeexception
Java Exception (runtimeException) is a common Exception that may be asked during the interview. It is a basic requirement. More .... Pay attention to the following common types of errors: NullPointerException-null pointer reference exception
ClassCastException-type forced conversion exception.
IllegalArgumentException-An error occurred while passing invalid parameters.
ArithmeticException-arithmetic operation exception
ArrayStoreException-An error occurred while saving an incompatible object with the declared type to the array.
IndexOutOfBoundsException-subscript out-of-bounds exception
NegativeArraySizeException-An error occurred while creating an array of negative values.
NumberFormatException-numeric format exception
SecurityException-security exception
UnsupportedOperationException-unsupported operation exception
Arithmetic exception class: ArithmeticExecption
Null Pointer exception class: NullPointerException
Type forced conversion exception: ClassCastException
Array negative subscript exception: NegativeArrayException
Array subscript out of bounds exception: ArrayIndexOutOfBoundsException
Security violation exception: SecturityException
File ended exception: EOFException
File not found exception: FileNotFoundException
An error occurred while converting the string to a number: NumberFormatException
Database Operation exception: SQLException
Input and Output exceptions: IOException
Method not found exception: NoSuchMethodException
Java. lang. AbstractMethodError
Incorrect abstract method. Thrown when an application tries to call an abstract method.
Java. lang. AssertionError
Assertion error. Used to indicate an assertion failure.
Java. lang. ClassCircularityError
Class loop dependency error. When initializing a class, if the cyclic dependency between classes is detected, this exception is thrown.
Java. lang. ClassFormatError
Class format error. When the Java Virtual Machine attempts to read a Java class from a file and detects that the content of the file does not conform to the valid format of the class, it throws.
Java. lang. Error
Error. Is the base class for all errors, used to identify serious program running problems. These problems usually describe abnormal situations that should not be captured by the application.
Java. lang. ExceptionInInitializerError
Initialization program error. Thrown when an exception occurs during the execution of a class static initialization program. Static initialization programs are static statement segments directly included in the class.
Java. lang. IllegalAccessError
Illegal access error. This exception is thrown when an application attempts to access, modify the Field of a class, or call its method, but violates the visibility Declaration of the domain or method.
Java. lang. IncompatibleClassChangeError
Incompatible class change error. This exception is thrown when the class definition on which the method being executed depends is incompatible. This error is easily caused when the Declaration definition of some classes in the application is modified without re-compiling the entire application.
Java. lang. InstantiationError
Instantiation error. This exception is thrown when an application attempts to construct an abstract class or interface using the new operator of Java.
Java. lang. InternalError
Internal error. Indicates that an internal error has occurred to the Java VM.
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, in this case, an error occurs.
Java. lang. NoClassDefFoundError
Class Definition error not found. This error is thrown when the Java Virtual Machine or classloader tries to instantiate a class but cannot find the definition of the class.
Java. lang. NoSuchFieldError
Domain does not exist. This error is thrown when an application attempts to access or modify a certain domain without the definition of this domain.
Java. lang. NoSuchMethodError
The method does not exist. This error is thrown when an application attempts to call a certain method without the definition of this method.
Java. lang. OutOfMemoryError
Memory insufficiency 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 hierarchy of recursive calls of an application is too deep, resulting in 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 the Java Virtual Machine has encountered an unknown serious error.
Java. lang. UnsatisfiedLinkError
A link error is returned. Thrown when the Java Virtual Machine does not find the native language definition of a class declared as the native method.
Java. lang. UnsupportedClassVersionError
Unsupported class version error. This error is thrown when the Java Virtual Machine attempts to read a class file but finds that the main and secondary versions of the file are not supported by the current Java virtual machine.
Java. lang. VerifyError
Verification error. This error is thrown when the validators detect internal incompatibility or security issues in a class file.
Java. lang. VirtualMachineError
Virtual Machine error. Indicates that the virtual machine is damaged or the resources required to continue the operation are insufficient.
Java. lang. ArithmeticException
Arithmetic condition exception. For example, integer division by zero.
Java. lang. ArrayIndexOutOfBoundsException
An error occurred while exiting the array index. If the index value of the array is negative or greater than or equal to the size of the array, throw.
Java. lang. ArrayStoreException
An error occurred while storing the array. It is thrown when a non-array declared object is stored in the array.
Java. lang. ClassCastException
Class styling exception. Suppose there are classes A and B (A is not the parent class or subclass of B), and O is the instance of A, then this exception is thrown when an instance of Class B is forcibly constructed by O. This exception is often called a forced type conversion exception.
Java. lang. ClassNotFoundException
Class exception not found. This exception is thrown when the application tries to construct a class based on the class name in the string format and cannot find the class file with the corresponding name after traversing the CLASSPAH.
Java. lang. CloneNotSupportedException
Clone exceptions are not supported. If the Cloneable interface is not implemented or the clone method is not supported, this exception is thrown when the clone () method is called.
Java. lang. EnumConstantNotPresentException
The enumerated constant does not exist. This exception is thrown when an application attempts to access an enumeration object by name or enumeration type, but this enumeration object does not contain constants.
Java. lang. Exception
Root exception. Used to describe what the application wants to capture.
Java. lang. IllegalAccessException
Illegal access exception. When an application tries to create an instance of a class, access this class attribute, and call this class method through reflection, at that time, the exception could not be thrown when defining the category, attribute, method, or constructor.
Java. lang. IllegalMonitorStateException
Illegal monitoring status exception. 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 this object (O.
Java. lang. IllegalStateException
Illegal status exception. If a method is called while the Java environment and application are not in the valid call state of a method, this exception is thrown.
Java. lang. IllegalThreadStateException
The invalid thread status is abnormal. When the county seat is not in the valid call status of a method and the method is called, an exception is thrown.
Java. lang. IndexOutOfBoundsException
An exception occurred when the index was out of bounds. This exception is thrown when the index value for accessing a sequence is smaller than 0 or greater than or equal to the sequence size.
Java. lang. InstantiationException
Instantiation exception. This exception is thrown when an instance of a class is created using the newInstance () method and the class is an abstract class or interface.
Java. lang. InterruptedException
Aborted exception. This exception is thrown when a Thread is in a long wait, sleep, or other pause State and other threads terminate the Thread through the interrupt method of the Thread.
Java. lang. NegativeArraySizeException
An error occurred while the array size is negative. This exception is thrown when an array is created with a negative value.
Java. lang. NoSuchFieldException
The property does not exist. This exception is thrown when you access a non-existent attribute of a class.
Java. lang. NoSuchMethodException
Method does not have an exception. This exception is thrown when a method that does not exist to access a class.
Java. lang. NullPointerException
Null Pointer exception. This exception is thrown when the application tries to use null where the object is required. For example, call the instance method of the null object, access the attribute of the null object, calculate the length of the null object, and throw null using the throw statement.
Java. lang. NumberFormatException
The number format is incorrect. This exception is thrown when you try to convert a String to a specified numeric type that does not meet the numeric type requirements.
Java. lang. RuntimeException
Exception during running. It is the parent class of all exceptions that can be thrown during normal operations of Java virtual machines.
Java. lang. SecurityException
Security exception. Thrown by the security manager to indicate exceptions that violate security conditions.
Java. lang. StringIndexOutOfBoundsException
An exception occurred when the string index was out of bounds. If the index value is used to access a character in a string and the index value is smaller than 0 or greater than or equal to the sequence size, this exception is thrown.
Java. lang. TypeNotPresentException
Type does not exist. When an application attempts to access a type by using a string expression of a type name, but cannot find the type based on the given name, this exception is thrown. This exception differs from ClassNotFoundException because it is an unchecked (not checked) exception, while ClassNotFoundException is a checked (checked) exception.
Java. lang. UnsupportedOperationException
The method is not supported. Exception that indicates that the requested method is not supported.