0

Interface: An interface implementation may be added to any existing third party class.

Abstract: A third party class must be rewritten to extend only from the abstract class.

I have read these in a site,I realize the first line but in the case of abstraction, I can't realize why a third party should be rewritten to extend. May anybody explain that?

samira riazati
  • 515
  • 7
  • 21

1 Answers1

0

Let's say the third party class, already inherits from a class(could be a class or abstract class). Now if you want your third party class to make use of this new abstract class, new set of classes have to be written. c# doesn't support inheritance of multiple classes. However in case of an interface, your existing third party class may just implement it, i.e. implement its methods.

blogbydev
  • 1,445
  • 2
  • 17
  • 29