首先调用哪个 - 基础构造函数或"其他东西"?
public class MyExceptionClass : Exception
{
public MyExceptionClass(string message, string extrainfo) : base(message)
{
//other stuff here
}
}
Run Code Online (Sandbox Code Playgroud) 在C#中,当你这样做时
Class(Type param1, Type param2) : base(param1)
Run Code Online (Sandbox Code Playgroud)
是先执行的类的构造函数,然后调用超类构造函数还是先调用基础构造函数?