In this article we are going to discuss difference between Abstract and Interface in C#. There are many blogs, articles are available on the internet regarding Abstract and Interface but in this particular article I will try to explain to you with as much as simple.
1. Abstract Class
Provides a base class that can include both fully implemented members and abstract members that must be implemented by derived classes.
1. Abstract class contains both DECLARATION & DEFINITION of methods.
2. Abstract class keyword: ABSTRACT
3. Abstract class does not support multiple inheritance
4. Abstract class can have constructors.
2. Interface
Defines a contract with no implementation. It specifies what methods, properties, events, or indexers a class should implement but does not provide any implementation.
1. Mostly Interfaces contain DECLARATION of methods. From C# 8.0 definition is also possible.
2. Interface keyword: INTERFACE
3. Interface supports multiple inheritance.
4. Interface do not have constructors.