You create two new classes 'Derived1' and 'Derived2', which are derived from the class 'Base'. Both of these classes override myMethod() with their own implementations.
You then create a class 'Derived12' which is derived from both 'Derived1' and 'Derived2' but does not override myMethod().
You declare an instance of Derived12 and call Derived12.myMethod().
Question: Which version of myMethod() will actually be called in this scenario? It will be one of the Derived* class' implementations, but which one?
This situation is known as the "Deadly Diamond of Death".
And as you can see, it's a little tricky. This is one reason why some languages choose not to support multiple inheritance.
To unsubscribe : [EMAIL PROTECTED]
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To reply to this message, go to:
http://groups.yahoo.com/group/Programmers-Town/post?act=reply&messageNum=4810
Please do not reply to this message via email. (more info)
- To visit your group on the web, go to:
http://groups.yahoo.com/group/Programmers-Town/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
