Solved

Why Interface

Posted on 2011-03-23
5
198 Views
Last Modified: 2013-12-17
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 .
0
Comment
Question by:mohantyd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 35196794
0
 
LVL 16

Expert Comment

by:Imran Javed Zia
ID: 35196856
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
 
LVL 10

Expert Comment

by:Mathiyazhagan
ID: 35197141
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
 
LVL 13

Expert Comment

by:Naman Goel
ID: 35197527
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
 
LVL 10

Accepted Solution

by:
khan_webguru earned 250 total points
ID: 35244597
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question