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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Munesh SharmaPosted Oct 7, 2015, 12:01 AM
Rajeesh MenothPosted Oct 7, 2015, 12:01 AM
David SmithPosted Oct 6, 2015, 11:59 PM
Munesh SharmaPosted Oct 6, 2015, 11:56 PM
Munesh SharmaPosted Oct 6, 2015, 11:55 PM
David SmithPosted Oct 6, 2015, 11:39 PM
David SmithPosted Oct 6, 2015, 3:55 PM
Rajeesh MenothPosted Oct 6, 2015, 1:43 PM
MahaPosted Oct 6, 2015, 6:44 AM
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.
David SmithPosted Oct 6, 2015, 1:15 AM
Nilesh JadavPosted Oct 6, 2015, 1:04 AM
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
Manas MohapatraPosted Oct 6, 2015, 1:04 AM