|
|
350 Mock Questions on SCJP 1.5 - JUST Rs.200 or 7 USD
Send us mail to sales@javabeat.net
more details
|
Do you have paypal account? Click Here to pay now and get the questions.
|
|
SCJP 5.0 Variable Arguments(Var agrgs) Mock Exam Questions - 2
2) What will be the output of the following program?
package var_arg;
public class VarArgTest1 {
public static void main(String[] args) {
acceptMultipleArguments(1);
acceptMultipleArguments(1, 2);
}
static void acceptMultipleArguments(var_arg int nums){
System.out.println(nums.length);
}
}
- The program will compile to produce the output 1 2.
- The program will not compile
- The program will compile but throw a run-time exception.
- The program will output 1 1.
Answer
2) 2
The program won't compile as there is no keyword called 'var_arg' in Java.
|
|
350 Mock Questions on SCJP 1.5 - JUST Rs.200 or 7 USD
Send us mail to sales@javabeat.net
more details
|
|