Thursday, July 23, 2015

Static Constructor in c#

Static constructor in c# is used to create static fields of the class and to write the code that needs to be executed only once.
-      Static constructor will not accept any parameters because it is automatically called by CLR.
-      Static constructor will not have any access modifiers.
-      Static constructor will execute automatically whenever we create first instance of class
-      Only one static constructor will allowed.

No comments:

Post a Comment