Difference between abstract class and interface
Answer Posted / mkm
)1. Accessibility modifier(Public/Private/internal) is
allowed for abstract class.
Interface doesn't allow accessibility modifier
2. class can inherit only one abstract class
class can implement more than one interface.
(2) An abstract class can contain fields,
constructors, or destructors and implement properties. An
interface can not contain fields, constructors, or
destructors and it has only the property's signature but no
implementation.
(3) An abstract class cannot support multiple
inheritance, but an interface can support multiple
inheritance. Thus a class may inherit several interfaces
but only one abstract class.
• Interface is used to "implements"; whereas abstract class
is used to "extends".
• Interface can be used to achieve multiple inheritance;
abstract class can be used as a single inheritance.
| Is This Answer Correct ? | 13 Yes | 2 No |
Post New Answer View All Answers
How can you pass multiple complex types in Web API?
How to find last error which occurred?
What is postback request?
Describe a Windows Service and its lifecycle ?
What is web api and why to use it?
Who is using asp.net?
What is the use of global.asax file?
What is http post action?
Explain repository pattern in asp.net mvc? : asp.net mvc
Why is xap important?
What is the Difference between MVC And MVP design pattrens
What are the different session state management options available in asp.net?
When should I use server transfer and response redirect?
What is asp.net with mvc? : Asp.Net MVC
From which base class all web forms are inherited?