yes, i am working on C#,
i am unable to understand "as-is", can u please give example.
Thanks
Tyr
Main Topics
Browse All TopicsWhat are the scenarios when we should only
Implement Interfaces, when only abstract classes and when both can be used.
multiple inheritance is not allowed i know that.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I do not use C#. The above "as is" is not a term, just the result of my poor English. I can only explain you the meaning (based on my C++ experience plus some info from C# reference).
In C#, you can use "abstract" modifier of the method declaration (http://msdn.microsoft.com
This also means that having only definition of the abstract class (the source files in C++ terms, or some bytecode that represents the abstract class in C#) is not enough to be able to use it. You have to use the abstract class as the base class of another, your, derrived class, and you have to implement the abstract methods. Still, you are forced to keep the method signature the same. (You use the override modifier.)
In C++, pure virtual methods are used in the role of abstract methods. In C#, you have the above mentioned specific keywords for that.
When the base class is written by someone else and the derived class is written by you, then the abstract method signature (i.e. the name, arguments and their types) is a way of forcing you to keep the way how the method will be called. If all methods in the C++ abstract base class are pure virtual (i.e. without implementation) and the class does not define any data member, then the abstract class has the features that are called "interface" elsewhere.
In C#, the interfaces are basically the same, only the syntax is simpler. The same way, you derive from the interface and you must implement its method. But the interface ensures that your implementation must be called the way that was enforced by the author of the interface.
For an interface, a base class, and multiple inheritance.... The multiple inheritance is not that big problem if the base classes do not have data members and if they use virtual methods. In such cases, it is also easy to replace the multiple inheritance by the chain of base classes using the single inheritance. This is why other languages may not want allow multiple inheritance, but allow you to use more than one interface (which is equivalent of multiple inheritance from more than one abstract classes.
Well, I may not to express some details clearly. Someone else can adds his/her view. ;)
You may be interested in "Designing with Interfaces: One Programmer's Struggle to Understand the Interface" by Bill Venners (http://www.artima.com/des
Business Accounts
Answer for Membership
by: peprPosted on 2008-07-01 at 01:58:49ID: 21905907
This is related also to the implementation language. Some languages do not support syntactically. For example, C++ uses abstract base classes to prescribe what interface (from logical point of view) should be implemented.
But, as C++ allows multiple inheritance, you are talking about Java or C# or something else. What is your goal?
Basically, interfaces are here to implement, well, an inerface to the calling objects. Abstract classes are here to implement base classes that cannot be used "as-is". The not-implemented methods must be implemented in derived classes.