Difference between abstract class and interface

Answer Posted / deepak jindal

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.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What happens to the winfx technologies?

573


Explain about developer benefit from memory management?

537


how can we achieve language interoperability through CLS? How MSIL works?

601


What is the cli? Is it the same as the clr?

512


What are the main Tools to develop .Net Application?

534






Explain the Lapsed Listener problem in .net

665


12. Types of polymorphisem[Run and Design Exp.]

1646


How does an appdomain get created?

551


Define cache coherency? : Dot net architecture

572


What are end points, contract, address and bindings?

525


What is gui programming? : .NET Architecture

503


Explain about continuable exceptions?

531


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

536


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

550


How resource files are used in .net?

545