Deepak Srivastava
When a Static Constructor called in .NET?
By Deepak Srivastava in C# on Oct 28 2012
  • Yogendra Yadav
    Mar, 2015 16

    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.

    • 0
  • Rakesh Shinde
    Apr, 2013 23

    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.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS