Tuesday, November 28, 2006 7:29 AM
Private, Public and Static Constructors in C#
A static constructor is one that can accept no arguments and is called only once during the entire application's lifecycle. It is invoked the first time when any static member of the class to which it belongs, is referenced. A private constructor prevents instantiation and subclassing of the class and a public constructor is called when the class is instantiated. It should be noted that we can have only one private or static constructor for a class. A private constructor of a class can however be accessed from other public constructors of the class through constructor chaining.
Please refer to my article for more details on this topic at the following link:--
An industry experience of over 10 years. Worked extensibly in Microsoft Technologies. Working in .Net and C# for over 5 years. Skills include,
I am currently working as a Technical Architect in a reputed MNC in Hyderabad, India. I have authored a lot of articles on .NET and its related technologies at ASPALLIANCE, DEVX, ASPNETPRO, CODERSOURCE, SQL-SERVER-PERFORMANCE.COM, SSWUG, etc.
Mail ID: email@example.com
I blog at: http://aspadvice.com/blogs/joydip/