---
title: "Differentiate between an abstract class and an interface?"  
description: "Differentiate between an abstract class and an interface?"  
author: "Ravi Vishwakarma"  
published: 2021-08-23  
updated: 2021-08-23  
canonical: https://www.mindstick.com/forum/156712/differentiate-between-an-abstract-class-and-an-interface  
category: "c#"  
tags: ["c#", "java", "c++"]  
reading_time: 3 minutes  

---

# Differentiate between an abstract class and an interface?

Differentiate between an [abstract](https://www.mindstick.com/forum/156718/when-to-use-abstract-classes-in-c-sharp) [class and an interface](https://www.mindstick.com/interview/33953/what-is-the-difference-between-an-abstract-class-and-an-interface-in-java)?

## Replies

### Reply by Ashutosh Kumar Verma

**Difference** **between [Abstract class](https://www.mindstick.com/articles/1430/abstract-class) and [Interface](https://www.mindstick.com/articles/12101/interfaces-in-java-extending-interfaces)**

There are some basic difference between abstract class and Interface

**Abstract class** **Interface**

\

| 1- There are must be used 'abstract' keyword to define an abstract class. | Here 'interface' is used to define Interface before its name. |
| --- | --- |
| e.g abstract class <class_name> | e.g interface <interface_name> |
| 2- An abstract class can contain abstract abstract methods and also regular methods. | In interface it can contain only methods |
| 3- Abstract class is generally inherits in derived class it is denoted with colon(**:**) | Interface is implement in regular class and it also used ( **:** ) for implementation. |
| 4- In abstract class there are not necessary to call of all methods of abstract class except all defined abstract method . | In interface there is must to call all declared method in interface because all methods are by default public and abstract. |
| 5- Instance variable can be declare in abstract class. | It is not allow to declare instance in interface |
| 6- In abstract class there is must use abstract keyword to declare a abstract method and also used 'override' keyword when it override in other regular class. | In interface methods are defined without using 'abstract' keyword and also does not need to use 'override' keyword to override that methods in regular class. |

**exe-**

```
abstract class Animal  {                                              interface  InterfaceClass    {        public abstract void Dog();                                    void Night(); // method without body        public void Cat()  {                                             }      Console.WriteLine('Cat cry like meuuuu');                           class Inte :InterfaceClass{        }                                                                 public void Night(){    }                                                                     Console.WriteLine('everyday '); //override    class Flower : Animal  {                                               }        public override void Dog()   {                                    }            Console.WriteLine('Dog is bark');                                 class Interface    {        }                                                                 static void Main(String[] arg)  {
    }                                                                      Inte inte =new Inte();    class Abstract    {                                                     inte.Night();        static void Main(string[] arg)   {                                  }            Flower rose = new Flower();                                    }            rose.Dog();                                                                                      rose.Cat();         }
```

}

**note-** we can pass parameter in abstract method in Abstract class and Interface. In both abstract class and interface, methods are declare without his body. Its being terminate by semicolon (**;**).\


---

Original Source: https://www.mindstick.com/forum/156712/differentiate-between-an-abstract-class-and-an-interface

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
