This one’s being bugging me for a while, why arn’t method signatures inclusive of return types?
I can’t have two methods in one class that only differ by return types though I can only differ in parameter type?
I realise this might be complicated to use but is there a practical reason why it isn’t supported? Until recently I assumed there was a technical reason why this wasn’t done since C++, Eiffel and Java don’t do it. However, I was just reading JSR 14 and noted that in some cases generics will produce byte code representing a class with two methods that only differ in return type. So the bytecode happily supports it but the language doesn’t?
Is it simply that it would be too complicated for us simpleton programmers to understand? The only thing that seems to be a problem is the ambuguities (sp?) caused but in other cases the compiler would simply flag these and expect the developer to resolve them…
Any thoughts appreciated,
Kev