August 2017
Beginner
566 pages
12h 34m
English
Here, after the try block, we'll enter the following after the last closing curly brace:
catch (DivideByZeroException ex)
You made a new DivideByZeroException object, then you're throwing an exception, and last, it's going to be caught down here in the catch block. So, to catch means to handle some of the values that are passed.
Enter the following between a set of curly braces below this line:
{ sampLabel.Text = ex.Message;
So, it's a message property that this object carries, the DivideByZeroException object, and you can display that message.
The DivisionByZeroException argument is used when you have problems with division by zero. But what if the input cannot be converted? You can handle that too. You can type the following, ...
Read now
Unlock full access