C# constructor
in c# can i decalare two default constructor in a single class
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Jul 7, 2012, 4:02 AM EDT
If it were allowed to have two, then there would be no way that the compiler could differentiate between them.
Notice also that the system only provides a default constructor, if you don't declare any constructors yourself. However, you are still allowed to create a single constructor which takes no parameters, if you wish.