DEV Community

kimia
kimia

Posted on

Static members in C#

Static members in C#
The main purpose of using static classes is to provide blueprints of their inherited classes.

Advantages of static classes

  1. Every member of a static class must be static or else you’ll get an error.
  2. Static members can only be accessed by their class name.
  3. Static class members are accessed by the class name followed by the member name.
  4. The static keyword is used before the class keyword in a class definition to declare a static class.

credits:https://www.c-sharpcorner.com/UploadFile/74ce7b/static-class-in-C-Sharp/

Image description

Top comments (0)