Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 01, 2013 04:29 AM by Angie xu - MSFT
Dec 25, 2012 03:49 PM|LINK
I know the difference between Interface and Abstract Classses, But i want to know in whcich situation Interfaces and Abstract Classes are used.
can any one please explain with an example.
Dec 25, 2012 04:12 PM|LINK
Here are some recommendations to help you to decide whether to use an interface or an abstract class to provide polymorphism for your components.
Dec 27, 2012 11:28 AM|LINK
Interfaces and abstract classes have so much in common it's hard to make a desision at times.
Though you are already aware of the differences between interface and abstract classes, here is a quick summary regardomg definiton and differences of the following two just for general benefit.
contains method definitions but does not contain any code nor any variables.
Abstracr Class: is a class that can not be instantiated but that can contain code. It
can contain internal member variables, and can contain basic behaviour in the form of methods that have been coded.
The following link leads to a tutorial that discusses plainly how to distinguish the two types and how to use them.
Hopefully this helps!
Best of Luck!
With Kind Regards,
Dec 29, 2012 06:07 AM|LINK
interfaces is actually a contract --you have to implement full interfaces & not any part .
These are binding but they normally make malleable entities and can be used for a variety of purposes -- i.e., talking of the same interface , as they do not have any implementations
abstract classes contain abstract methods indeed but not all of them .
Jan 01, 2013 04:29 AM|LINK
It's an old topic about the choice of Interfaces and Abstract Classes, The choice of whether to design your functionality as an interface or an abstract class can sometimes be a difficult one.
An abstract class is a class that cannot be instantiated, but must be inherited from. An abstract class may be fully implemented, but is more usually partially implemented or not implemented at all, thereby encapsulating common functionality for
and I think recommendations for Abstract Classes vs. Interfaces could be a good guide for you