Virtual/Abstract fields in C#

前端 未结 9 1211
逝去的感伤
逝去的感伤 2020-12-16 10:19

Is it possible to have a virtual/abstract field in a C# class? If so, how is it done?

9条回答
  •  佛祖请我去吃肉
    2020-12-16 10:29

    The first sentence of the MSDN documentation answers your question:

    The virtual keyword is used to modify a method, property, indexer or event declaration, and allow it to be overridden in a derived class.

    http://msdn.microsoft.com/en-us/library/9fkccyh4(v=vs.80).aspx

提交回复
热议问题