Why static constructor cant take parameter and do not have access modifier?

Posted by Murugavelmsc under Interview Questions on 4/11/2013 | Points: 10 | Views : 2510 | Status : [Member] | Replies : 2
Why static constructor cant take parameter and do not have access modifier?

Regards,
Murugavel S
murugavel.sadagopan@gmail.com
http://murugavelmsc.blogspot.in/



Responses

Posted by: Satyapriyanayak on: 4/11/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
A static constructor is called automatically to initialize the class before the first instance is created, therefore you can't send it any parameters.

http://msdn.microsoft.com/en-us/library/k9x6w0hc%28v=vs.80%29.aspx
http://msdn.microsoft.com/en-us/library/k9x6w0hc.aspx

If this post helps you mark it as answer
Thanks

Murugavelmsc, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: manoranjanguptaoutlook-19221 on: 4/11/2013 [Member] Starter | Points: 25

Up
0
Down
Hello

Static constructors are called automatically as part of type initialization. They're not called explicitly
So we cant provide argument to correspond constructor.....


Manoranjan Gupta Manu
9873306227

Murugavelmsc, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response