You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
- 1Never heard of polymorphy, you mean polymorphism?Steven Jeuris– Steven Jeuris2011-09-14 14:13:47 +00:00Commented Sep 14, 2011 at 14:13
- 1that being said, if microsoft allowed multiple inheritance in the first place, there would have been no reason for existence of interfacesPankaj Upadhyay– Pankaj Upadhyay2011-09-14 14:15:06 +00:00Commented Sep 14, 2011 at 14:15
- 11@Pankaj Upadhyay: Multiple inheritance and interfaces are two different pairs of shoes. What if you need an interface of two unrelated classes with different behaviour? You can't solve that by multiple inheritance. You HAVE TO implement it separately anyway. And then you'll need something to describe the interface in order to provide polymorphic behaviour. Multiple inheritance is a blind alley to walk down in many cases, and it's too easy to shoot yourself in the foot sooner or later.Falcon– Falcon2011-09-14 14:17:50 +00:00Commented Sep 14, 2011 at 14:17
- 1Lets simplify. If my interface implements two functions Display and Comment, and I have a class which implements them. Then why not I remove the interface and use the functions directly. What i am saying is that they are merely providing you the names of the functions that are needed to be implemented. If one can remember those functions then why create an interfacePankaj Upadhyay– Pankaj Upadhyay2011-09-14 14:25:11 +00:00Commented Sep 14, 2011 at 14:25
- 9@Pankaj, if that is all that you need the interface for, then don't use it. YOu use an interface when you have a program that wants to be ignorant of every aspect of the class and access it by its base Type, i.e. the interface. They don't need to know any of the subclasses, just that it is of the type of the interface. As such, you can then call the implemented method of the sub-class through the reference to the object's interface. This is basic inheritance and design stuff. Without it, you might as well use C. Even if you don't explicitly use it, the framework would not work without it.Jonathan Henson– Jonathan Henson2011-09-14 14:33:15 +00:00Commented Sep 14, 2011 at 14:33
| Show 10 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you