The class which contain only static member and we canot create the instances of that class is called static class.
- They only contain static members.
- They cannot be instantiated.
- They are sealed.
- They cannot contain Instance Constructors
When to Use ?
when we have to separate data and behavior that will be independent of any object identity. The data and functions do not change regardless of what happens to the object.
For Example Connection String of web confi file,mathematics function, or a currency converter class etc.
- Compiler makes sure that no instance of static class is created and no instance members are declared within a static class. In previous version of C#, the constructor has to be marked private to avoid this from happening.
- Static class also makes the implementation simpler and faster since we do not have to make instance of the class to call its method.
For more information refer this link