1.What is the difference between an abstract class and interface. I am still lost when it comes to explaining this to someone.
2. When to use abstract class?
3. When to use an interface?
1.What is the difference between an abstract class and interface. I am still lost when it comes to explaining this to someone.
2. When to use abstract class?
3. When to use an interface?
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
Manas MohapatraRank #182 · 13.2K reputationPosted Oct 5, 2015, 9:04 PM EDT
Nilesh JadavRank #109 · 20.3K reputationPosted Oct 5, 2015, 9:04 PM EDT
Check this link to know the difference :
1) http://programmers.stackexchange.com/questions/41740/when-to-use-abstract-classes-instead-of-interfaces-with-extension-methods-in-c
Thank you
David SmithRank #999 · 2K reputationPosted Oct 5, 2015, 9:15 PM EDT
MahaRank #2,573 · 543 reputationPosted Oct 6, 2015, 2:44 AM EDT
2. When to use abstract class?
Sometimes a parent class is so general that you never intend to create any specific instances of the class. For example, you might never create "just" an Artist; each Artist is more specifically a Painter, Sculptor, Illustrator, and so on. A class that you create only to extend from, but not to instantiate from, is an abstract class.
3. When to use an interface?
Multiple inheritances are not allowed in C#. In order to meet such a requirement Interfaces are used.
Rajeesh MenothRank #118 · 18.4K reputationPosted Oct 6, 2015, 9:43 AM EDT
David SmithRank #999 · 2K reputationPosted Oct 6, 2015, 11:55 AM EDT
David SmithRank #999 · 2K reputationPosted Oct 6, 2015, 7:39 PM EDT
Munesh SharmaRank #174 · 13.9K reputationPosted Oct 6, 2015, 7:55 PM EDT
Munesh SharmaRank #174 · 13.9K reputationPosted Oct 6, 2015, 7:56 PM EDT
David SmithRank #999 · 2K reputationPosted Oct 6, 2015, 7:59 PM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Oct 6, 2015, 8:01 PM EDT
Munesh SharmaRank #174 · 13.9K reputationPosted Oct 6, 2015, 8:01 PM EDT