WHAT IS THE MAIN DIFFERENCE BETWEEN STATIC CONSTRUCTOR & PRIVATE CONSTRUCTOR?

Posted by Avdesh under C# on 9/18/2011 | Points: 10 | Views : 4008 | Status : [Member] | Replies : 2
ITS URGENT TELL ME THE ANSWER IN 1 HOUR PPLSSSSSSSSSSS




Responses

Posted by: Akiii on: 9/18/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,
Please check the links:-

http://www.dotnetuncle.com/OOPS/27_static_constructor.aspx

http://www.dotnetperls.com/private-constructor

I hope this helps.....
Thanks and Regards
Akiii

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

Posted by: Vuyiswamb on: 9/18/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
see this

1) Static constructor will be called first time when the class is referenced. Static constructor is used to initialize static members of the class.
2)
In the non static class the private or public constructor will not be called. Static members will not be initialized either by private or public constructor.

in reference to this
http://forums.asp.net/t/1673708.aspx/1?Difference+between+Static+class+and+Private+constructor+class

Thank you for posting at Dotnetfunda
[Administrator]

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

Login to post response