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
Explain repository pattern in asp.net mvc? : asp.net mvc
What are the HTML server controls in ASP.NET?
Can you explain composite pattern?
What is the purpose of url encoding?
What websites use asp.net?
How will you load dynamic assembly? How will create assesblies at run time?
Can you explain autopostback?
What is Pre-Render event in ASP.NET?
What is the significance of ASP.NET routing?
Explain the difference between page.registerclientscriptblock and page.registerstartupscript?
How to communicate via Remote proxy with Client? a)MarshalByRef b)Marshal by Value or Any thing else?
How many types of file extensions for razor views in ASP.Net MVC?
What are strong names?
Describe the sequence of action takes place on the server when ASP.NET application starts first time?
What are user controls?