RuntimeExceptions Flashcards
Thrown when an arithmetic error occurs, such as when attempting to divide by zero.
ArithmeticException
Thrown for an attempt to write beyond a buffers limits.
BufferOverflowException, BufferUnderflowException
Thrown when an attempt is made to cast between incompatible types, such as String to Integer.
ClassCastException
Thrown when an attempt is made to create an array of negative size.
NegativeArraySizeException
Thrown when an attempt is made to use the nextElement() method on an Enumeration when no more values exist to access.
NoSuchElementException
When an attempt is made to use a method or access a field on a null reference.
NullPointerException
Thrown when an attempt is made to apply an operation that is not supported or that does not exist ( for example, attempting to write to a read only file system will result in throwing a ReadOnlyFileSystemException, which is a derived class of this exception.)
UnsupportedOperationException
Thrown when an incorrect or inappropriate argument is passed to a method.
IllegalArgumentException
Thrown when an attempt is made to access a data structure using an index value that is not within the permissible range; base class of ArrayIndexOutOfBoundsException and StringIndexOutOfBoundsException
IndexOutOfBoundsException