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.

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

Comments

Bharti said…
http://getproductprice.com/Ads-what-is-constructor-and-its-types-with-example.aspx

Popular posts from this blog

How do I calculate a MD5 hash from a string?

What is WSDL?