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


Please Help Members By Posting Answers For Below Questions

how we can fire event in databound column in datagrid without using button?

588


What is Video Streaming in .net??

550


Why am I getting an invalidoperationexception when I serialize an arraylist?

483


What is the difference between metadata and menifest ?

469


Can I customise the trace output?

634






Session State and can i store desirialized object in state server, if yes how and if not why.

1348


Explain .net mobile input controls? : Microsoft dot net mobile

482


What is msil, and why should my developers need an appreciation of it if at all?

535


Can I create my own metadata attributes?

528


What do you know about machine.config file ?

568


Explain the difference between state server and sqlserver : Dot net architecture

453


Explain about common language infrastructure?

562


How to improve the cache performance? : Dot net architecture

529


How can we integrate atlas with web services?

519


How can I create a application?

512