“Cannot create an instance of the abstract class or interface” C# error message

前端 未结 3 992
傲寒
傲寒 2020-12-19 06:09

I changed my base class to abstract for a project and now I\'m receiving the following error:

Cannot create an instance of the abstract c

3条回答
  •  醉酒成梦
    2020-12-19 06:48

    You can't create an instance of an abstract class. Think of it as an interface that may contain some implementation logic as well. What would you expect to happen if you called an abstract instance method with no definition?

提交回复
热议问题