| Author |
var-args doubt clarification needed
|
asha parek
Greenhorn
Joined: Sep 07, 2011
Posts: 6
|
|
The test question is:
Which, inserted independently at line 6, will compile? (Choose all that apply.)
A. static void doStuff(int... doArgs) { }
B. static void doStuff(int[] doArgs) { }
C. static void doStuff(int doArgs...) { }
D. static void doStuff(int... doArgs, int y) { }
E. static void doStuff(int x, int... doArgs) { }
Why option D is not correct?
|
 |
bhanu chowdary
Ranch Hand
Joined: Mar 09, 2010
Posts: 256
|
|
Ashwini Welcome to the Ranch
Option D is not correct because varargs parameter should be the last parameter.
|
 |
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6588
|
|
Welcome to JR
Please QuoteYourSources
|
SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
|
 |
 |
|
|
subject: var-args doubt clarification needed
|
|
|