Creating Understanding and Educating Programmers, Developers and Technical Communities, one post at a time.

Tuesday, April 16, 2013

Static Constructor in C#

In C#, static constructor is always private and it does not need explicit access modifier, it does not take parameters and only good for initialization of static members of class. Static constructor calls before first instance of class's object and user does not really have any control on it.

Singleton pattern also take the advantage of static constructor of C#.