W
weird0
How does C++ and C# solve the Diamond problem? With the help of
interfaces that is.
Can anyone elaborate .......
Regards
interfaces that is.
Can anyone elaborate .......
Regards
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
weird0 said:How does C++ and C# solve the Diamond problem? With the help of
interfaces that is.
weird0 said:How does C++ and C# solve the Diamond problem? With the help of
interfaces that is.
Can anyone elaborate .......
Regards
What is the diamond problem?
Base Class A
Classes B and C derived from A
Class D derived from B and C (mulitple inheritence).
DeveloperX said:I should of added the diamond problem is where B and C both have a
method or property with the same name. What happens in D?
I'm having a bad day, and google groups is playing up now too *rant*
But as has been said, C# doesn't have multiple inheritance. I think your
lecturer is asking you a trick question <g>
C# does support multiple interface implementation and has both implicit and
explicit interfaces. Explicit interfaces don't suffer from member name
clashes.- Hide quoted text -
- Show quoted text -

DeveloperX said:I should of added the diamond problem is where B and C both have a
method or property with the same name. What happens in D?
I'm having a bad day, and google groups is playing up now too *rant*
How does C++ and C# solve the Diamond problem? With the help of
interfaces that is.
Norman Diamond said:The Diamond solution was going to be explicit declarations where the
derived class would say which base class members would be unified and
which would be separated as separate members. Also it would have allowed
optional renaming in inheritance, so that maintenance programmers could
decide for themselves how to choose the lesser of two maintenance
nightmares every time it came up. But that was 19 years ago, it wasn't
for C++ or C#, and my then-employer had lied when they said they wanted me
to work on this kind of thing.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.