Solved

Why Interface

Posted on 2011-03-23
5
194 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
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now