Base Class Doesn't Contain Parameterless Constructor?

前端 未结 6 2029
别那么骄傲
别那么骄傲 2021-02-01 01:11

I\'m making my constructors a bit more strict by removing some of my empty constructors. I\'m pretty new to inheritance, and was perplexed with the error that I got: Base Class

6条回答
  •  天命终不由人
    2021-02-01 01:19

    Because if A has no default constructor then the constructor of A2 needs to call base() with the arguments to the constructor of A. See this question: Calling the base constructor in C#

提交回复
热议问题