2
Reply

When a Static Constructor called in .NET?

Deepak Srivastava

Deepak Srivastava

Oct 28, 2012
1.9k
0

    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.

    Yogendra Yadav
    March 16, 2015
    0

    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.

    Rakesh Shinde
    April 23, 2013
    0