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 is the numeric attribute of the textbox control in .net mobile? : Microsoft dot net mobile

722


What are library functions?

712


6. Wcf- what is SOA

2046


How can we perform data binding in atlas?

682


What is the problem with .net generics?

820


What is boxing and unboxing? Does it occure automaatically or you need to write code to box and unbox?

733


Explain the number or character entered through keyboard gets converted to equivalent ascii code & it get stored on ram in the binary form. What is the exact procedure on hardware that converts the ascii value to binary? : .NET Architecture

640


Explain different pipelining hazards? : Dot net architecture

668


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

828


How do I write to the application configuration file at runtime?

704


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

719


Explain about appdomains?

782


What is the difference between l1 and l2 cache? : Dot net architecture

712


What are the types of memory management? : Dot net architecture

672


When do I need to use gc.keepalive?

841