Can I have New MyException(“My exception”). If it is possible what should be the datatype of myexception variable.
Use it like @lakshman said. If you want to store it in a variable you can use “System.Exception” datatype.
Hey @Shashi123
You can.
public class MyException: Exception
{
public MyException(string message): base(message)
{
}
}
Regards…!!
Aksh
2 Likes