Dominique LeBlond: what happened in base class instructor

Dec 8 2004 6:46 AM
public class MyException : Exception { public MyException ( string message ) : base ( message ) { } } try { if(len>5) throw new MyException("length cannot be > 5"); } catch (MyException my) { Console.WriteLine(my.Message); } //----------------------------------- above, "length cannot be > 5" passed as parameter to base class constructor. What happened in base class instructor? How /why "length cannot be > 5" passed to catch block?

Answers (3)