Why is multiple inheritance of interfaces a much less difficult thing to achieve than multiple inheritance from a set of classes?
I am stuck on a university question.
Thanks
Why is multiple inheritance of interfaces a much less difficult thing to achieve than
Share
If you inherit two methods with the same signature from different classes, you have an ambiguity when calling this method. It can be resolved, but it is arguably a messy situation.
If you implement two interfaces with the same method signature, it doesn’t matter, because there’s still just one implementation to choose from when calling the method.
The diamond problem is an extension of the problem described above, which makes the situation even messier. This problem basically goes away when restricting multiple inheritance to interfaces.