Loading

Q1.

Which symbol is used to declare variable arguments in Java?

A. *
B. ...

C. @

D. #

Q2.

How many varargs parameters are allowed in a single method?

A. Unlimited
B. Only one
C. Two
D. None

Q3.

 Which of the following is a valid varargs method declaration?

A. void display(int... nums)

B. void display(int... nums, int x)

C. void display(int x, int... nums, int y)

D. void display(int nums...)

Q4.

What is the type of a varargs parameter inside the method?

A. List
B. Array
C. String
D. Object

Q5.

Which statement is TRUE about varargs in Java?

A. You cannot call a method with zero arguments if it has varargs

B. Varargs can accept only one argument

C. Varargs reduces the need for method overloading

D. A method can have multiple varargs parameters