In what scenarios will you use an abstract class and in what scenarios will you use an interface?
- If you want to increase reusability in inheritance then abstract classes are good.
- If you want to implement or force some methods across classes must be for uniformity you can use an interface.
- So to increase reusability via inheritance use the abstract class as it is nothing but a base class and to force methods to use interfaces.
Some points about Abstract Class:
- We cannot create an object of an Abstract Class.
- An Abstract Class can be inherited with its derived class.
- We can have both concrete and abstract methods but at least one abstract method is compulsory in an Abstract Class.
- An Abstract Class is used as a base class for projects.
- An Abstract Class can inherit another base class and base interfaces.
- The constructor of an Abstract Class can be called through the derived class constructor.
- An Abstract Class should be used for a large project to share the common functionality with its derived class.
- All abstract methods must be implemented in its derived class if inherited.
Some important things about interfaces
- We cannot create an object of an interface; we can only create a reference or Interface Variable.
- An interface will have only abstract methods (method declaration).
- Interfaces support Inheritance, Polymorphism (Overloading, Overriding (using the "new" keyword to hide the interface methods above)).
- We cannot create variables in an interface.
- Only Properties, Indexers, Methods and Events are allowed in an interface.
- A class can inherit multiple interfaces, which is also shown in the snapshot above.
- We cannot create any Access modifiers with Interface Members (like private, public, protected, internal, protected internal, virtual, override, static, abstract etc.)
- The new keyword is allowed in an interface.
- All methods of an interface must be defined in every derived class.
- An interface is good for small or medium level projects.
| Abstract Class | Interface |
|
|
|
|
|
|
|
|
|
|
Main Difference
An Abstract Class should be used for a large project to share the common functionality with its derived class.
An interface is good for small or medium level projects.
An Abstract Class should be used for a large project to share the common functionality with its derived class.
An interface is good for small or medium level projects.

Priyanka YadavPosted Feb 15, 2019, 2:58 AM
Useful article .. Keep it up!!
Shruti SopalPosted Aug 23, 2018, 12:42 AM
Good article Pravin
Bhavesh JadavPosted Aug 6, 2018, 6:44 AM
Great explanation Pravin.
kashid siddhuPosted Aug 3, 2018, 12:58 AM
Hey, Pravin very nice article. it's very useful to interview prospective & understanding the real use of abstract class & interface.
Shrimant TelgavePosted Aug 2, 2018, 11:32 AM
Very helpful
Liu PenghaoPosted Aug 1, 2018, 8:41 AM
Very helpful,thank you!
Akshay BvsrPosted Aug 1, 2018, 12:32 AM
Very nice article, very helpful
Sujit JadhavPosted Aug 1, 2018, 12:24 AM
Nicely prepared, Useful article for interview preparation. Keep it Up..
Balu ShindePosted Aug 1, 2018, 12:23 AM
Very useful question for an interview