2
Reply

When a Static Constructor called in .NET?

    Static Constructor is called before you use anything in class but exactly when that happens is up to the implementation . If class is never used,the static constructor is not guaranteed to be called at all.

    Static constructor is used to initialize static data members as soon as the class is referenced first time, whereas an instance constructor is used to create an instance of that class with keyword. A static constructor does not take access modifiers or have parameters and can't access any non-static data member of a class.