Difference between abstract class and interface

Answer Posted / arjunrao

(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 ?    591 Yes 61 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Whate are resource files? How are they used in .net?

491


Explain the difference between l1 and l2 cache? : .NET Architecture

549


What other than biginteger has been introduced in system.numerics namespace?

528


Do you know textbox and textview controls of .net mobile? : Microsoft dot net mobile

505


Explain how to develop mobile applications using microsoft mobile internet toolkit (mmit) or .net mobile? : Microsoft dot net mobile

499






Explain about developer benefit from memory management?

537


how to use custom field validation

2049


What is the difference between machine config vs. Web config : Dot net architecture

491


if there are two application 1 and 2 having a variable x in both app if client1 changes value of x in 1 app client 2 want reads the value of x from 2 app what resultant value will he get

1853


What is Object Caching in Visual Studio 2010?

596


Explain cache? : Dot net architecture

589


Explain the race around condition? : .NET Architecture How can it be overcome? : .NET Architecture

497


Whats new features in Visual Studio 2012?

546


What is a clickonce application?

508


What size is a .net object?

632