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

Explain the race around condition? How can it be overcome? : Dot net architecture

723


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

756


Explain about metadata?

717


When do I need to use gc.keepalive?

842


What is WPF and WCF?

762


What does this do? Gacutil /l | find /i "corillian"

799


Differnce between managed code and unmanaged code ?

731


Explain different pipelining hazards and how are they eliminated? : .NET Architecture

721


Can I create my own context attributes?

728


server.transfer limitation ?

1970


Explain about the base class library provided by microsoft.net?

734


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

677


hi, kindly send WWF(.net 3.5) pdf notes to my id. thanx in advance, chays

2077


What does the term "green architecture" mean? : .NET Architecture

737


question related to table havi colspan and row span

1959