Using exception handling

While working on a project, it is better to use exception handling because it reduces the risk of errors. For instance, using the Try catch block can give you a proper error message, which helps us handle exceptions. There are various exception handling techniques that have been explained earlier and that are very useful while working on a project. An example featuring using the Try catch activity to handle exceptions has been shown in the figure. Here, we have used the Write line activity to display messages in the case of any error detected by the Catch block or the Finally block (as highlighted in the screenshot):

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.86.134