Difference Between Abstract Class and Interfaces In C#

Abstract Class and Interfaces are always hot topics in C# language in terms of many ways including interviews and normal developer discussions during lunch and walk .So to add something in it and to help beginners and students  I have decided to write this small article to explain difference between Abstract Class and Interfaces.
So lets see
Abstract Class Interfaces
Classes may inherit only one abstract class. Class may inherit multiple interfaces.
Abstract Class members have access modifiers. Interface members are by default public.
Abstract Class methods have implementation or no implementation. Interface methods have no implementation.
An Abstract Class contains abstract as well as non-abstract methods. Interface has only abstract methods.
When you want an implementation or no implementation of methods then use an abstract class. If you do not want any implementation of methods then use interfaces.
For more details about Abstract and Interfaces please refer my following articles
I hope this article is useful for all readers , If you have any suggestion regarding this article then please contact me. 

Post a Comment


Protected by Copyscape
Copyright © Compilemode