This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes SCJP Chapter 01 Self Test Qn no. 3 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "SCJP Chapter 01 Self Test Qn no. 3" Watch "SCJP Chapter 01 Self Test Qn no. 3" New topic
Author

SCJP Chapter 01 Self Test Qn no. 3

kiruthigha rajan
Ranch Hand

Joined: Dec 29, 2011
Posts: 69

Answer:
-> A and E use valid var-args syntax.
My Doubt Is Why "Option B" Is Wrong ??
thanks in advance
Md. Minhajur Rahman
Ranch Hand

Joined: Apr 10, 2012
Posts: 33
Hello rajan,
Option B is not correct. Because If you use it, then at line 3 and 4 will cause compilor error as it couldn't find match. Because doStuff(1) expect a function that takes an integer argument not an integer array argument (except var-args). Same reason for doStuff(1,2).
kiruthigha rajan
Ranch Hand

Joined: Dec 29, 2011
Posts: 69
Md. Minhajur Rahman wrote:Hello rajan,
Option B is not correct. Because If you use it, then at line 3 and 4 will cause compilor error as it couldn't find match. Because doStuff(1) expect a function that takes an integer argument not an integer array argument (except var-args). Same reason for doStuff(1,2).


now its clear..thanks alot sir..
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: SCJP Chapter 01 Self Test Qn no. 3
 
Similar Threads
varargs doubt
var-args doubt clarification needed
DOUBT from scjp book
New type of var-args syntax (at least to me)
Gotcha: Varargs spoofs method signature [from Sierra/Bates book]