I expected that all static variables and initialization blocks are executed when class is accessed first time. But, when reading http://msdn.microsoft.com/en-us/library/ff650316.aspx, I found the following statement:
"Because the Singleton instance is referenced by a private static member variable, the instantiation does not occur until the class is first referenced by a call to the
I searched MSDN website and got confused even more:
"The static field variable initializers of a class correspond to a sequence of assignments that are executed in the textual order in which they appear in the class declaration. If a static constructor
(Section 10.11) exists in the class, execution of the static field initializers occurs immediately prior to executing that static constructor."
Can anyone please refer me to detailed description of initialization process.
View Complete Post