---
title: "Difference Between Interface vs Abstract Class in C#"  
description: "Interface and Abstract class both are using to achieve Abstraction in C#."  
author: "Anupam Mishra"  
published: 2015-12-17  
updated: 2017-12-14  
canonical: https://www.mindstick.com/articles/11956/difference-between-interface-vs-abstract-class-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# Difference Between Interface vs Abstract Class in C#

[Interface and Abstract](https://www.mindstick.com/forum/157791/explain-the-difference-between-interface-and-abstract-class-with-examples) class both are using to achieve [Abstraction](https://www.mindstick.com/articles/944/abstraction-in-c-sharp) in C#.Interface are achieving fully (100%) abstraction but [abstract class](https://www.mindstick.com/articles/1430/abstract-class) is partially (0-100%).

Interface provide only declaration not [definition](https://yourviews.mindstick.com/view/70598/false-furore-over-the-leadership-definition-statement-of-army-chief-bipin-rawat) but abstract class using both. We can’t declared member in interface. In interface all methods are public. In Interface we can’t defined keyword static virtual, abstract or sealed. We have not create any instance of abstract class. If any class is one method are abstract then that class must be make as abstract. Abstract class is using for providing common definition of a [base class](https://www.mindstick.com/blog/116/base-class-initilization) that multiple [derived class](https://answers.mindstick.com/qa/30686/what-is-a-base-class-and-derived-class) can share.

We have achieved multiple inheritance by using [interface in c#](https://www.mindstick.com/articles/12036/interface-in-c-sharp). If base class is an abstract class then derived class inherit only one abstract class at a time.i.e. We will not achieving [multiple inheritance](https://www.mindstick.com/forum/159471/how-does-c-plus-plus-support-multiple-inheritance-and-what-are-potential-issues-associated-with-it) using abstract class. But using interface we will accomplish this task very quickly.

**For Example ,**

```
using System; namespace InterfaceEx{   //declaring interface     public interface Bank    {       void RateOfInterest();    }    //defining class that implement Bank interface  public class PNB:Bank    {      //Given body to the interface method       public void RateOfInterest()        {            Console.WriteLine("Interest Rate of PNB is : 7 %");        }    }   //defining class that implement Bank interface and containing main method   public  class SBI:Bank    {       //Given body to the interface method       public void RateOfInterest()       {    Console.WriteLine("Interest Rate of SBI is : 6 %");       }              static void Main(string[] args)        {           // creating instance of the class            PNB pnb = new PNB();   //call class method which are given  body that are defined in interface             pnb.RateOfInterest();            SBI p = new SBI();            p.RateOfInterest();            Console.ReadKey();          }    }} 
```

##### For Abstract class:

```
using System; namespace AbstractClassEx{ abstract class Car    {       //normal method        public void setName()        {            Console.WriteLine("New Car Name is: Swift Dezire Turbo");        }       //virtual function that override in derived class      public virtual void setFeature()        {            Console.WriteLine("Dramastic changes in Feature");                }       //abstract method         public abstract void Design();   }   class Program:Car    {       //Giving body to abstract method      public override void Design()       {           Console.WriteLine("Degisns very New & Energetic");        }     //override virtual method      public override void setFeature()       {           Console.WriteLine("Its Internal  Feature");       }        static void Main(string[] args)        {              //Creating instancs             Program p = new Program();           //calling abstract class method             p.setName();             p.Design();             p.setFeature();             Console.ReadKey();        }    }
```

---

Original Source: https://www.mindstick.com/articles/11956/difference-between-interface-vs-abstract-class-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
