我希望子类使用其父类的构造函数.但似乎我总是需要在子类中再次定义它们才能使它工作,如下所示:
public SubClass(int x, int y) : base (x, y) { //no code here }
所以我想知道我是不是在父类中正确地声明了构造函数,或者根本没有直接的构造函数继承?
c# inheritance multiple-constructors inherited-constructors
c# ×1
inheritance ×1
inherited-constructors ×1
multiple-constructors ×1