aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes varargs doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "varargs doubt" Watch "varargs doubt" New topic
Author

varargs doubt

tushar panda
Ranch Hand

Joined: Feb 16, 2009
Posts: 133
this is a self test question from pg-79 of K&B book

question is :


given choice for answer :


the answer given is A & E.

i think the answer should be only E because each method has argument " 1" so 1st argument is fixed . morever option A takes a number of arguments but option E takes the first argument that is same in both methods { i.e 1 } & then any number of arguments.

am i misinterpreting something or is it right ? if right explain


Do Right , Fear No Man
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3825

Varargs accepts zero(0) or more number of arguments (0,1,2 etc...). Now can you understand the reasoning for the given answer?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: varargs doubt