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
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to