Why can't I create an abstract constructor on an abstract C# class?

后端 未结 8 2141
无人及你
无人及你 2020-11-28 08:08

I am creating an abstract class. I want each of my derived classes to be forced to implement a specific signature of constructor. As such, I did what I would have done has I

8条回答
  •  萌比男神i
    2020-11-28 09:05

    hope this will help someone newb as i am i was looking to make a "normal" public class with a ctor that takes argument and then i needed to make it a child class so i needed an empty ctor for it.

    i didnt know this before: if you make a protected ctor then the child class sees it but the rest of the program dont see it (i guess my confusion is since in asp.net i see all the protected in the aspx page which inherits from the cs...)

提交回复
热议问题