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

Explain pipelining? : Dot net architecture

787


Why only boxed types can be unboxed?

864


What's new in the .net 2.0 class library?

749


How to improve the cache performance? : Dot net architecture

747


Explain difference between state server and sqlserver? : .NET Architecture

754


what is the method while we are using adapter and dataset ?

1600


Explain about continuable exceptions?

749


What is cookie less session?

800


What is IL code, CLR, CTS, GAC & GC?

813


What is .net mobile automatic paging? : Microsoft dot net mobile

790


Can I customise the trace output?

866


State and explain about microsoft.net?

743


What is .net mobile utility controls. Explain with an example? : Microsoft dot net mobile

667


Explain write back and write through caches? : Dot net architecture

797


i wish to write mcts(microsoft certified technology specialist) exam. can anyone give the model question or format and preparation method?

2554