Static constractors in C#

Question posted in Computer Software on 02 2010
Rate question difficulty level 1 Votes
Are static constractors exists in c#? if so, what they used for?
 
 
3 Answers
 
Static constructor is used to initialize static data members as soon as the class is referenced first time, whereas an instance constructor is used to create an instance of that class with keyword. A static constructor does not take access modifiers or have parameters and can't access any non-static data member of a class.

Since static constructor is a class constructor, they are guaranteed to be called as soon as we refer to that class or by creating an instance of that class.


02/11/2010
 
 
Heck yeah bay-bee keep them cionmg!

01/11/2012
 
 

01/12/2012
 
 
Add an answer*
 
Your name
Email
 
Company: Microsoft
Location: Hertzliya , Israel
C# ctor static

add a question

arrow_blue


Now hiring!
---------------------------
---------------------------
---------------------------
Mercer 
---------------------------
---------------------------
---------------------------
---------------------------