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
Solved

Why Interface

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

808 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