Difference between abstract class and interface
Answer Posted / rubeena
(1) An abstract class may contain complete or
incomplete methods. Interfaces can contain only the
signature of a method but no body. Thus an abstract class
can implement methods but an interface can not implement
methods.
(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.
(4) A class implementing an interface has to
implement all the methods of the interface, but the same is
not required in the case of an abstract Class.
(5) Various access modifiers such as abstract,
protected, internal, public, virtual, etc. are useful in
abstract Classes but not in interfaces.
(6) Abstract classes are faster than interfaces
| Is This Answer Correct ? | 107 Yes | 23 No |
Post New Answer View All Answers
What is WPF and WCF?
Explain the race around condition? : .NET Architecture How can it be overcome? : .NET Architecture
Define dma? : Dot net architecture
how to set the startup position of the form?
What is private constructor? And it's use?
6. Wcf- what is SOA
What is the purpose of cache? How is it used? : Dot net architecture
How do I know when my thread pool work item has completed?
Xmlserializer is throwing a generic "there was an error reflecting myclass" error. How do I find out what the problem is?
Explain about microsoft visual studio?
how we can fire event in databound column in datagrid without using button?
Describe the advantages of writing a managed code application instead of unmanaged one. What is involved in certain piece of code being managed?
Explain the difference between l1 and l2 cache? : .NET Architecture
What are different types that a variable can be defined and their scopes ?
What is an interrupt? : Dot net architecture