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

where should I put this information then?

587


Explain the Lapsed Listener problem in .net

673


What are the different pipelining hazards and how are they eliminated? : Dot net architecture

600


How to prevent my .NET DLL to be decompiled?

574


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

597






I can't be bothered with cas. Can I turn it off?

536


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

528


Explain cache memory? : .NET Architecture

550


Which software is used for .net programming?

530


Use of Enable view state ? if turn off what happen ?

3817


What is .net viewstate?

494


difference between data reader and dataset

1789


Explain the number or character entered through keyboard gets converted to equivalent ascii code & it get stored on ram in the binary form.

522


How to improve the cache performance? : Dot net architecture

530


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

2312