• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ambiguity in calling Varargs

 
amarkirt saroay
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
abhishek pendkay
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
amarkirt saroay
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you compile the java file after removing the method?
 
amarkirt saroay
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ,Its working
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic