Difference between abstract class and interface

Answer Posted / rajneesh hajela

ABSTRACT CLASS:
1) we can't create object of abstract class.
2) we can declare a variable.
3) we can make normal method and abstract method.
4) we can't make method body with abstract method.
5) in derived class we can use abstract method by override
keyword.
6) we can't use multiple inheritance in abstract class.
7) Absrtact class can be extended by only one class;
Interface can be implemented by more than one class;
ie. class can inherit only one abstract class


8)Abstract classes can inherit interfaces while interfaces
cannot inherit abstract classes
but class can implement more than one interface.
9) The members of the interface are public with no
implementation. Abstract classes can have protected
parts,static methods, etc.

10)An abstract class can contain fields,
constructors, or destructors and implement properties. An
interface can not contain fields, constructors, or
destructors and it has abstractmethod,property's signature
but no implementation etc.

Rajneesh Hajela
Gwalior(M.P.)

Is This Answer Correct ?    52 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about common language infrastructure?

721


What is the use of web.config?

784


how to create applications by using Visual Studio 2012?

720


What is Video Streaming in .net??

739


Explain about appdomains?

780


Explain the types of memory management? : .NET Architecture

680


How to implement the display in the class printdoc (how to resolve the naming conflict) a: no naming conflicts

817


Explain how does .net mobile work? : Microsoft dot net mobile

651


Tell me .net mobile emulators? : Microsoft dot net mobile

716


data types used in validation control

1920


Explain about generation?

733


Define a virtual memory? : Dot net architecture

675


Explain .net mobile automatic paging? : Microsoft dot net mobile

673


What is a service class?

730


What is .net mobile images control. : Microsoft dot net mobile

678