What is Static Constructor ?

It is a special type of constructor, introduced with C#. It gets called before the creation of the first object of a class(probably at the time of loading an assembly). See example below.

Example:
public class SomeClass()
{
static SomeClass()
{
//Static members may be accessed from here
//Code for Initialization
}
}

Comments

Popular posts from this blog

How do I calculate a MD5 hash from a string?

What is WSDL?