Java Language Design Decision: Multiple interfaces with same signature, but different return types

75 Views Asked by At

I'm studying for the 1Z0-819 exam and learned that a class cannot implement two interfaces having the same signature (method name + param type list) but different return types. I know there are several other questions on SO asking if you can do this, or asking about ways around it... I'm wondering why the writers of Java haven't built in a way to accomplish this. I imagine this is a real practical problem for library distributors - I would think trying to ensure a new package is compatible with the largest possible number of other libraries would be extremely difficult... Is this a conversation amongst library distributors?

0

There are 0 best solutions below