How does the compiler determine what the most "specific" method is?
I found this in the
JLS. The following line in particular I think fits my previous example...
The informal intuition is that one method declaration is more specific than another if any invocation handled by the first method could be passed on to the other one without a compile-time type error. In this case invoking p.abs(b), V.abs(int a) is more specific than V.abs(float a) or V.abs(double a) because invoking V.abs(int a) could easily be passed on to V.abs(float a) without a problem.
Is this a correct interpretation of the rule?
Cliff
[ January 11, 2004: Message edited by: Cliff DeRose ]
[ January 11, 2004: Message edited by: Cliff DeRose ]