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
abstract
is that it cannot be instantiated.sealed
is that is cannot be inherited.That's what a static
class actually is -- a class that cannot be instantiated and that cannot be inherited.
So the article doesn't state you should mark your static classes as abstract
and sealed
additionally, but this is the way how static classes are represented in IL.
(Other languages may allow you to do this if they do not have a static
keyword, although I doubt it, because an abstract sealed
class doesn't make a lot of sense semantically.)