What is an exception and what are the advantages of exception handling mechanism.
Exception are the runtime errors.
1)Exception provides the means to separate the details of what to do when something out of the ordinary happens from the main logic of a program.
2)One of the significance of this mechanism is that it throws an exception whenever a calling method encounters an error providing that the calling method takes care of that error.
3)With the help of this mechanism the working code and the error-handling code can be disintegrated. It also gives us the scope of organizing and differentiating between different error types using a separate block of codes. This is done with the help of try-catch blocks.
4)Furthermore the errors can be propagated up the method call stack i.e. problems occurring at the lower level in the chain can be handled by the methods higher up the call chain.
For more information, visit the following link: