Static class in c# sharp .net

The following list provides the main features of a static class:

  • Contains only static members.
  • Cannot be instantiated.
  • Is sealed.
  • Cannot contain Instance Constructors
  • Cannot inherit from any class except Object. .
  • Can have static constructor
  • A static class can be used as a convenient container for sets of methods that just operate on input parameters and do not have to get or set any internal instance fields.
  • C# does not support static local variables (variables that are declared in method scope)
  • Static methods can be overloaded but not overridden, because they belong to the class, and not to any instance of the class.

2 thoughts on “Static class in c# sharp .net

Leave a Reply

Your email address will not be published. Required fields are marked *