Java’s built-in exceptions:
Java’s built-in exceptions are provided in the package “java.lang”. every exception is available in the form of a class.
The following are the list of exceptions available.
- Arithmetic Exception: An arithmetic error such as division by zero.
- ArrayIndexOutOfBounds Exception: Array index is out of bonds.
- ArraySotreException: Assignment to an array element of an incompatible type.
- ClassCastException: Invalid cast.
- IllegalMonitorStateException: Illegal argument used to invoke a method.
- NoClassDefFoundError Exception:
- NoSuchMethod Exception: A requested method does not exist.
- Interrupted Exception: One thread has been interrupted by another thread.
- NoSuchFieldException: A request field does not exist.
- IllegalMonitorState Exception: Illegal monitor operation such as waiting on unlocked thread.
- IllegalStateException: Application is in an incorrect state.
- IllegalThreadStateException: Requested operation not compatible with the current thread.
- IndexOutOfBoundsException: Some type of index is out of bounds.
- NullPointerException: Invalid use of an null reference.
- NumberFormatException: Invalied convertion of a String to a numeric format.
- SecurityException: Attempt to violate security.
- StringIndexOutOfBounds: Attempt to index outside the bounds of a String.
- UnsupportedOperationException: An unsupported operation was encountered.
- ClassNotFoundException: A specified class was not found.
- IllegalAccessException: Access to a class is denied.
- InstatiationException: Attempt to create an object of an abstract class or interface.
- SQL Exception.
- Servlet Exception.
- IOException.
- Socket Exception. Etc…
