Explain how exception handling mechanism can be used for debugging a program
Answers
Answer:Any good program makes use of a language’s exception handling mechanisms. There is no better way to frustrate an end-user then by having them run into an issue with your software and displaying a big ugly error message on the screen, followed by a program crash. Exception handling is all about ensuring that when your program encounters an issue, it will continue to run and provide informative feedback to the end-user or program administrator. Any Java programmer becomes familiar with exception handling on day one, as some Java code won’t even compile unless there is some form of exception handling put into place via the try-catch-finally syntax. Python has similar constructs to that of Java, and we’ll discuss them in this chapter.
Explanation:
After you have found an exception, or preferably before your software is distributed, you should go through the code and debug it in order to find and repair the erroneous code. There are many different ways to debug and repair code; we will go through some debugging methodologies in this chapter. In Python as well as Java, the assert keyword can help out tremendously in this area. We’ll cover assert in depth here and learn the different ways that it can be used to help you out and save time debugging those hard-to-find errors.
Answer:Any good Program makes use of a language’s Exception Handling mechanisms. There is no better way to frustrate an end user than by having them run into an issue with your software and displaying a big erro_r message on the screenfollowed by a program crash. Exception handling is all about ensuring that when your program encounters an issue it will continue to run and provide informative feedback to the end-user or program administrator. Any Java programmer becomes familiar with exception handling on day one as some Java code won’t even compile unless there is some Kind of exception handling put into place via the try-catch-finally syntax. Python has similar constructs to that of Java.
Explanation:
After you have found an exception or preferably before your software is distributed, you should go through the code and debug it in order to find and repair the erroneous code. There are many different ways to debug and repair code; we will go through some debugging methodologies in this chapter. In Python as well as Java, the assert keyword can help out tremendously in this area. We’ll cover assert in depth here and learn the different ways that it can be used to help you out and save time debugging those hard-to-find errors
#SPJ2