Hi....
Ques : C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?
C# provides a default constructor
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


VulpesRank #55 · 29.2K reputationPosted Jan 17, 2012, 12:52 PM EST
If you create a constructor which takes a parameter, then the system no longer provides a default parameterless one. If you still want a parameterless constructor, you therefore have to provide it yourself.