Exception Handling

Posted on

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.

  1. Arithmetic Exception: An arithmetic error such as division by zero.
  2. ArrayIndexOutOfBounds Exception: Array index is out of bonds.
  3. ArraySotreException: Assignment to an array element of an incompatible type.
  4. ClassCastException: Invalid cast.
  5. IllegalMonitorStateException: Illegal argument used to invoke a method.
  6. NoClassDefFoundError Exception:
  7. NoSuchMethod Exception: A requested method does not exist.
  8. Interrupted Exception: One thread has been interrupted by another thread.
  9. NoSuchFieldException: A request field does not exist.
  10. IllegalMonitorState Exception: Illegal monitor operation such as waiting on unlocked thread.
  11. IllegalStateException: Application is in an incorrect state.
  12. IllegalThreadStateException: Requested operation not compatible with the current thread.
  13. IndexOutOfBoundsException: Some type of index is out of bounds.
  14. NullPointerException: Invalid use of an null reference.
  15. NumberFormatException: Invalied convertion of a String to a numeric format.
  16. SecurityException: Attempt to violate security.
  17. StringIndexOutOfBounds: Attempt to index outside the bounds of a String.
  18. UnsupportedOperationException: An unsupported operation was encountered.
  19. ClassNotFoundException: A specified class was not found.
  20. IllegalAccessException: Access to a class is denied.
  21. InstatiationException: Attempt to create an object of an abstract class or interface.
  22. SQL Exception.
  23. Servlet Exception.
  24. IOException.
  25. Socket Exception. Etc…

Leave a Reply

Your email address will not be published. Required fields are marked *