Click here to Skip to main content
15,894,546 members
Articles / Programming Languages / C#

How to call an overloaded constructors in C#

Rate me:
Please Sign up or sign in to vote.
4.67/5 (3 votes)
20 Sep 2011CPOL 11.7K   1  
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();}

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.
15 Sep 2011Reiss 1 alternative  
A guide on how to call overload constructors in C#

License

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


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

Comments and Discussions