Handling Exception and use of CX_ROOT directly and subclasses

Java 8Object Oriented ProgrammingProgramming

It is not advisable to use CX_ROOT directly and you would require using one of its direct subclasses. Also, the propagation depends upon the exception subclass hierarchy.

  • Subclasses of CX_STATIC_CHECK – these do not propagate automatically. You will need to do the handling yourself or there will be a syntax error in the program.
  • Subclasses of CX_DYNAMIC_CHECK – these do not require any handling. But the program that does not handle the exception will be aborted with these subclasses.
  • Subclasses of CX_NO_CHECK – These will get propagated automatically if the exception is not handled.
raja
Published on 15-Dec-2017 15:14:26
Advertisements