Showing posts with label abstract class and interface. Show all posts
Showing posts with label abstract class and interface. Show all posts

Wednesday, March 2, 2016

What is the difference between abstract class and interface in c#?

Abstract class


  • Abstract class not not support multiple inheritance
  • It contains constructor
  • An abstract class contains access modifier
  • Fast execution to find the actual method in the class
  • in abstract class fields and constraints have defined
  • An abstract class provides the complete code 
  •  Member of the abstract class can be static  
 Interface 


  • Interface support multiple inheritance
  • It does not contain constructor
  • an interface not not have any access modifier
  • Take more time to find the actual method in the class
  • fields can not be defined in the interface
  • An interface can not provide any code rather then the signature
  • member of the static class can not be static