Can a child class have multiple parents? What is a good example of this? Can multiple child classes have the same parent? Can you provide an example of this as well? Thank you.
In .NET languages, you cannot have multiple inheritance at all, so it's a single parent to child relationship. However, in native C++, you can have multiple inheritance -- hence, a many to one relationship.
While it is possible, in most good development shops, multiple inheritance is considered very poor programming practices. In fact, for the developers in my shop, we consider it a reason to fail a code review. The problem is that it makes the code much harder to read (as in "where the heck did this method come from?") and adds a considerable amount of complexity to the overall code. You're goal when coding is to make a correct, maintainable solution that a new hire fresh out of college can read.
Dig Deeper on Win Development Resources
Related Q&A from John Robbins
What is a JAD session? This term is referred to often in job postings and seems like some kind of brainstorm you carry out with a client to define IT... Continue Reading