Difference Between Class and Interfaces In C#

In this article we will learn about the difference between the class and Interfaces , I got many emails and request from students and beginners to write something about it , So I have decided to write this article .
Instead of going depth lets start differentiation between these two as interview question prospective .

Class Interfaces
Classes have any access modifier. It cannot be allowed to be declared as private.
We can create instances of classes. Cannot create an instance of an interface.
Class members have any access modifiers. Cannot apply any access modifier to members because by default they are public.
Class methods have an implementation. Interface methods have no implementation.
A class contains any type of method. Interface has only abstract methods.
Cannot inherit multiple classes. Multiple Interfaces are inherited.

For more depth details about classes 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 or you can post your suggestion in comment box.  

Post a Comment


Protected by Copyscape
Copyright © Compilemode