How different are interface and abstract class in .Net?

Showing Answers 1 - 13 of 13 Answers

Chandra kumar

  • May 26th, 2006
 

Abstract Class - Blue print of class

Interfaces - Only implemented members, such as  property,index,methods,events

  Was this answer useful?  Yes

Abstract classes can not be instantiated it can have or cannot have abstract method basically known as mustinherit as the methods are static in nature

where interfaces are the declaration and r defined where they are called used for dynamic methods

  Was this answer useful?  Yes

rekhs

  • Jun 12th, 2006
 

Hai,

     Abstract class: It can't be instantiated.Some methods may abstract. It can't be implemented. It bis the blueprint of the class.

Interface: It can be instantiated.All the methods should be abstract. it can be implemented

  Was this answer useful?  Yes

debiprosad lahiri

  • Jun 19th, 2006
 

Abstract class is a class which can only be inherited by a subclass whereas in an interface only some signatures will be provided. In case of interface the class that will implement this must write code against each methods / functions. Interface can inherit other interface only where an abstract class can inherit other classes . When my base class will be used by more than one group of user and they all might not use all the methods that my class will provide in that case we should go for an abstract class rather than an interface.

Public MustInherit class A

Interface A

  Was this answer useful?  Yes

venkat

  • Jul 28th, 2006
 

1.We can't create instances for both

2.Single inheritance in abstract class, multible inheritance in interface

3.We can have concrete method in abstact class but not in the interface.

4.Any class that needs to use abstract must extent

5.Any class that needs to use interface must implement

5.Interface all the variables are static and final.

diksha

  • Sep 22nd, 2006
 

abstract classes can have some methods dclared only not defined,these methods are later definedin classes that will inherit abstract class

interface will have no method defined,methods are only declared they are defined in class which implements interface

interface is implemented

abstract class is inherited

  Was this answer useful?  Yes

praveenoruganti

  • Oct 16th, 2006
 

interface is nothing but no functionality with some definition in it.

  Was this answer useful?  Yes

Leelakrishnan

  • Feb 2nd, 2007
 

Hi, Inferface can be used as a contract for other classes.

  Was this answer useful?  Yes

biswo123

  • Dec 8th, 2008
 

- Abstract class contains one or more incomplete methods while an interface contains only the signatures of all the methods.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions