Why declare static classes as sealed and abstract in C#?

后端 未结 4 1325
你的背包
你的背包 2020-12-09 21:16

This MSDN article states that static classes should be declared as sealed and abstract. I was under the impression that static classes were already sealed. Why would you als

4条回答
  •  清歌不尽
    2020-12-09 22:09

    I think the pertinent bit from that article is:

    "Do declare static classes as sealed and abstract, and add a private instance constructor, if your programming language does not have built-in support for static classes."

    Remember, the .NET framework supports a lot of different languages.

提交回复
热议问题