Interface and Class in C#

Interface is more popular and used in single-inheritance class model languages. There object's interface is used by making instances of objects.

The languages which supports multi-inheritance class model, there classes & different methods are used instead of Interface.

But, I prefer Interface mechanism over multi-inheritance class.

A little difference between Interface & Class (for C#) are as\

  • Class - procedures/ methods (with definition) +.. ex. Data members
  • Interface - have methods without definitions
     
  • Class - doesn't support multiple inheritances.
  • Interface - are used to get the functionality of class multi-inheritance by implementing interfaces ( refer - different instances)


     
Ebook Download
View all
Learn
View all