Static class (C #),
Basic Introduction:
Class can be declared as static to indicate that it only contains static members. You cannot use the new keyword to create a static class instance. When a static class loads a program or namespace containing the class, it is automatically loaded by the. NET Framework Common Language Runtime Library (CLR; specifically: C # language.
Advantages:
The advantage of using static classes is that the compiler can perform checks to prevent accidental addition of instance members. The compiler will never create such instances. Static classes are sealed and therefore cannot be inherited. A static class cannot contain constructor, but can still declare a static constructor to assign an initial value or set a static state. Note: The static class cannot have an instance constructor. Static classes cannot have any instance members. Static classes cannot use abstract or sealed modifiers. Static classes are inherited from the System. Object root class by default, and cannot explicitly specify any other base classes. Static classes cannot specify any interface implementation. A static class member cannot have a protected or protected internal access protection modifier.