Here are some other common exceptions:
-
ArithmeticException:This exception occurs if you try to perform an illegal math operation, such as dividing by zero (0). (This will occur only
with integer arithmetic because floating-point operations do not throw exceptions.)
-
ArrayIndexOutOfBoundsException:Java will throw this exception if you try to access an element beyond the end of an array.
-
InterruptedException:If a thread interrupts another thread in an unexpected way, Java will throw this exception.
-
IOException:You will receive this exception if an error occurred with input/output, such as reading past the end of a file.
-
NumberFormatException:If Java encounters an error when converting a string to a number, it will throw this exception.
-
NullPointerException:If you use a null pointer inappropriately, such as the target of a method call, you'll receive this exception.
-
OutOfMemoryException:Java will throw this exception if you run out of working memory.
Check out the Java APIs for more information on Java's various exceptions.