How can implement class which derived from system.exeption?
I tried to implement that code:
try
{
CheckDivideByZero(num1, num2);
}
catch (FirstDivideByZeroException)
{
Console.WriteLine("first number is zero");
}
I need that, FirstDivideByZeroException class will handle that Exeption instead of DevideByZeroExeption.
I tried to do that:
public class
FirstDivideByZeroException : DivideByZeroException {}
but when i run the application, that message appear:
"An unhandled exception of type 'System.DivideByZeroException' occurred .."
How can i implement that?