Wednesday, 15 April 2020

SE - 48 - Checked Vs Unchecked Exceptions!

Checked Exceptions are also called as Compile Time Exceptions as these are checked by compiler during compilation. It just ensures to get the error handled by user during coding. Few of the major compile time exceptions are : 

IOException -  Its subclasses are  : FileNotFoundException, EOFException, UnsupportedEncodingException, SocketException, and SSLException

SQLException - Its subclasses are  : SQLClientInfoException , SQLDataException , SQLFeatureNotSupportedException ,SQLIntegrityConstraintViolationException
SQLInvalidAuthorizationSpecException ,SQLSyntaxErrorException , SQLTransactionRollbackException ,SQLTransientConnectionException

DataAccessException
ClassNotFoundException
InvocationTargetException


UnChecked Exceptions are also called as Run Time Exceptions as these are identified during runtime. All Errors are Unchecked also. Runtime exception is superclass of all the run-time exceptions :  Few of the major compile time exceptions are : 

  • ArithmeticException
  • ArrayStoreException
  • ClassCastException
  • ConcurrentModificationException
  • EnumConstantNotPresentException
  • IllegalArgumentException - IllegalThreadStateException,NumberFormatException
  • IllegalMonitorStateException
  • IllegalStateException
  • IndexOutOfBoundsException - ArrayIndexOutOfBoundsException, StringIndexOutOfBoundsException
  • NegativeArraySizeException
  • NullPointerException
  • SecurityException
  • TypeNotPresentException
  • UnsupportedOperationException

No comments:

Post a Comment