Difference between interface and abstract class


Difference between abstract class and interface is one of the most asked question in interview.
Lets have a look on difference between interface and abstract class. 

Abstract Class vs Interface 


  • Abstract classed can have implementation for some of its members, but interface can not have implementation of any members. 
  • An interface can not contain fields but an abstract class can contain fields. 
  • Interface members are by default public and no explicit access modifier require, but abstract class members can have access modifiers. 
  • An interface can be inherited from another interface only and not from an abstract class, but abstract class can inherit from another abstract class or from interface.
  • Interface can not contain constructors.

Comments

Popular

Top 8 C# 6.0 Features

SharePoint Interview Questions and Answers

Calling ASP.Net WebMethod using jQuery AJAX

What is Cloud Computing - A guide for beginners