Cheers<br />-------------<br />Swapnil<br /> <br />SCJP5-81%<br /> <br />"Dictionary is the only place where Success come before Work"
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Cheers<br />-------------<br />Swapnil<br /> <br />SCJP5-81%<br /> <br />"Dictionary is the only place where Success come before Work"
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
all events occur in real time
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
all events occur in real time
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
So the first bit (fixed arity) works as expected with normal specificity rules (under which short <: int); but this same rule also seems to apply to the remaining variable arity (var-args) part.Summarised from the JLS:
Method A has n parameters (T1, ..., T(n-1), Tn[]) and method B has k parameters (U1, ..., U(k-1), Uk[]), where n >= k (and [] notation means a var-arg construction, not an array).
Then A is more specific than B if:
(a) for all j from 1 to k-1, Tj <: Uj
and
(b) for all j from k to n, Tj <: Uk
It's probably low prority because no one actually writes such blatently unclear overloads outside the SCJP exam! Just like the exam seems to like to use overloads with int and Integer, who would actually write such unclear (and unnecessary) code in reality?Originally posted by Barry Gaunt:
I notice that the bug is dated 2004 and has not been fixed yet.
Cheers<br />-------------<br />Swapnil<br /> <br />SCJP5-81%<br /> <br />"Dictionary is the only place where Success come before Work"
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |