Click here to Skip to main content
15,886,258 members
Articles / Programming Languages / C#

How to call an overloaded constructors in C#

Rate me:
Please Sign up or sign in to vote.
5.00/5 (10 votes)
15 Sep 2011CPOL 53.5K   10  
A guide on how to call overload constructors in C#

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
20 Sep 2011Robert Ludwig
All three of the Something methods could be replaced with a single definition of the form:public Something(string name = "default", index = -1){ myName = name; myIndex= index; DoStuff();}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Program Manager
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions