Content deleted Content added
Timtempleton (talk | contribs) m typo fix |
Timtempleton (talk | contribs) m →C# static constructor: bolded term |
||
Line 180:
==== C# static constructor ====
In [[C Sharp (programming language)|C#]], a '''static constructor''' is a static data initializer. Static constructors allow complex static variable initialization.<ref>[http://msdn.microsoft.com/en-us/library/k9x6w0hc%28VS.80%29.aspx Static Constructor in C# on MSDN]</ref>
Static constructors are called implicitly when the class is first accessed. Any call to a class (static or constructor call), triggers the static constructor execution.
Static constructors are [[thread]] safe and implement a [[singleton pattern]]. When used in a [[generic programming]] class, static constructors are called at every new generic instantiation one per type. Static variables are instantiated as well.
|