prev prev
  Course navigation
 
Java's exceptions
Additional common exceptions
Here are some other common exceptions:
  1. 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.)
  2. ArrayIndexOutOfBoundsException--Java will throw this exception if you try to access an element beyond the end of an array.
  3. InterruptedException--If a thread interrupts another thread in an unexpected way, Java will throw this exception.
  4. IOException--You will receive this exception if an error occurred with input/output, such as reading past the end of a file.
  5. NumberFormatException--If Java encounters an error when converting a string to a number, it will throw this exception.
  6. NullPointerException--If you use a null pointer inappropriately, such as the target of a method call, you'll receive this exception.
  7. 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.
  Course navigation