Constructors in Abstract Class
Is it possible to form Constructor In abstract Class ?? If formed then why cant we create its intsance??
2 Answers
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 attend4days leftRegister
Bhushan GawaleRank #299 · 8.4K reputationPosted Jan 27, 2015, 8:53 PM EST
Consider the scenario wherein the child class inheriting from the base abstract class wants to inherit the base constructor or abstract class's constructor needs to initialize some member variables.
You can refer this nice example explains the use of the abstract class's constructor
http://stackoverflow.com/questions/19944644/why-can-an-abstract-class-have-constructor
Michal HabalcikRank #902 · 2.3K reputationPosted Jan 27, 2015, 8:58 PM EST
Here is some more info from MSDN: Abstract types should not have constructors