Why Interface

An abstract class can do all stuff what an interface does . Though Multiple inheritence not possible in abstract class with interface its possible. But why the interface concept came .
mohantydAsked:
Who is Participating?
 
khan_webguruCommented:
Hello Bro!

Please find the attached sample code from code project I used once to fix the problem. Hope this will help you.

sample-Code.docx

Regards,

AAK
0
 
Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:
Hi,
It is simple, you can implement multiple Interfaces further more abstract can be only one and must be used as parent.
http://www.codeproject.com/KB/cs/abstractsvsinterfaces.aspx
Thanks
0
 
MathiyazhaganCommented:
One more great article from Code Project :
http://www.codeproject.com/KB/architecture/Abstract_Interface.aspx

and have attached PDF of an article (from DigCode, as now the link is not working). Interface-vs.-Abstract-Clas.pdf
Hope this helps.
0
 
Naman GoelSoftware engineer 1Commented:
Interface is something like a contract between class and Interface, it is like a menu card that facilitates a class that what type of implementation it contains. for example if you implemented IEnumerable outside class or user of class can expect that you had implemented GetEnumerator() method, in similar way if you had implemented IDisposable along with IEnumerable the user of that object can expect Dispose is being implemented in that class, so interface purely facilitates a class to implement multiple features into the class.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.