1
Answer

How can implement class which derived from system.exeption?

Avi Ozer

Avi Ozer

18y
2.8k
1
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?
Answers (1)