This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Ambiguity in calling Varargs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Ambiguity in calling Varargs" Watch "Ambiguity in calling Varargs" New topic
Author

Ambiguity in calling Varargs

amarkirt saroay
Ranch Hand

Joined: Mar 16, 2008
Posts: 167
Compiler error that it is ambigous to decide which method to call.But even if i remove the first method public void method( Integer... I ) it does not take up the second version.why?
Codse is taken from a mock exam SCJP_1.5_Questions_with_answers


SCJP-75%
SCWCD-82%
abhishek pendkay
Ranch Hand

Joined: Jan 01, 2007
Posts: 184
Originally Quoted by amarkirt
But even if i remove the first method public void method( Integer... I ) it does not take up the second version.why?




I commented out the first method and it is working.... did you miss out something in your code..??
[ March 23, 2008: Message edited by: abhishek pendkay ]

The significant problems we face cannot be solved by the same level of thinking which created them – Einstein
SCJP 1.5, SCWCD, SCBCD in the making
amarkirt saroay
Ranch Hand

Joined: Mar 16, 2008
Posts: 167
No,I am still getting compiler error saying "The method int,int,int ) is undefined for the type test.and similar errors in the following other lines.
balajee annamalai
Ranch Hand

Joined: May 09, 2007
Posts: 31
Did you compile the java file after removing the method?
amarkirt saroay
Ranch Hand

Joined: Mar 16, 2008
Posts: 167
Thanks ,Its working
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Ambiguity in calling Varargs